V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
mirrorpen
V2EX  ›  问与答

ajax 跨域问题

  •  
  •   mirrorpen · 2018-01-10 16:55:19 +08:00 · 1291 次点击
    这是一个创建于 2296 天前的主题,其中的信息可能已经有所发展或是发生改变。

    项目是在 A 公众号里的一个分享链接,因为 XX 原因,用户点开后是向 B 公众号授权,我的做法是:
    网上找了个可以用 appid 重定向授权的方法,前端发送请求,我把前端请求的接口重定向到另一个接口,为了拿微信授权..
    结果一直出现跨域问题,可是我后端有加( Access-Control-Allow-Origin: *)这个头部,安全问题先不管,前端是也试了用 jsonp,但还是无法解决问题,求大佬指教,后端 php



    图片好小,我把报错贴出来
    Failed to load "http://xxx": Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://xxx' is therefore not allowed access. The response had HTTP status code 405.
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   3312 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 11:27 · PVG 19:27 · LAX 04:27 · JFK 07:27
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.