后端接口的初始化函数里放入
header("Access-Control-Allow-Origin: *");
// 响应类型
header('Access-Control-Allow-Methods:*');
// 响应头设置
header('Access-Control-Allow-Headers:x-requested-with,content-type');
后端接口的初始化函数里放入
header("Access-Control-Allow-Origin: *");
// 响应类型
header('Access-Control-Allow-Methods:*');
// 响应头设置
header('Access-Control-Allow-Headers:x-requested-with,content-type');
本文标题:ajax cors 跨域解决
本文链接:https://www.haomeiwen.com/subject/hervjctx.html
网友评论