美文网首页
ajax cors 跨域解决

ajax cors 跨域解决

作者: 莫奈的有趣灵魂 | 来源:发表于2019-08-13 11:06 被阅读0次

后端接口的初始化函数里放入

        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