mirrorpen
V2EX  ›  问与答

ajax 跨域问题

  •  
  •   mirrorpen · Jan 10, 2018 · 1664 views
    This topic created in 3075 days ago, the information mentioned may be changed or developed.

    项目是在 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.
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1039 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 23:08 · PVG 07:08 · LAX 16:08 · JFK 19:08
    ♥ Do have faith in what you're doing.