ThinkPHP5 解决跨域

index.php 中添加

//允许跨域
header('Access-Control-Allow-Origin:*');
// 响应类型
header('Access-Control-Allow-Methods:*');
// 响应头设置
header('Access-Control-Allow-Headers:x-requested-with,content-type');
发布了22 篇原创文章 · 获赞 16 · 访问量 1548

猜你喜欢

转载自blog.csdn.net/ZhangJiWei_2019/article/details/103421608