// 指定允许其他域名访问
header('Access-Control-Allow-Origin:*');
// 响应类型
header("Access-Control-Allow-Methods: POST, GET, OPTIONS, PUT, DELETE");
// 响应头设置
header('Access-Control-Allow-Headers:x-requested-with,content-type');
// 指定允许其他域名访问
header('Access-Control-Allow-Origin:*');
// 响应类型
header("Access-Control-Allow-Methods: POST, GET, OPTIONS, PUT, DELETE");
// 响应头设置
转载于:https://www.cnblogs.com/weihua2018/p/9357322.html