tp5跨域处理

在这里插入图片描述

header("Access-Control-Allow-Origin:*");
header("Access-Control-Allow-Methods:GET, POST, OPTIONS, DELETE");
header("Access-Control-Allow-Headers:DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type, Accept-Language, Origin, Accept-Encoding");

将上面这些代码加在前面

发布了122 篇原创文章 · 获赞 5 · 访问量 4846

猜你喜欢

转载自blog.csdn.net/weixin_41254345/article/details/103793039
tp5