ThinkPHP5允许跨域请求

2023-05-04T17:50:00

在入口文件加入这个就可以跨域请求了

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");
当前页面是本站的「Baidu MIP」版。发表评论请点击:完整版 »