急!第三方网页通过微信公众号授权跨域问题?
发布于 6 年前 作者 yang44 10870 次浏览 来自 问答


流程: 前端请求后台接口,后台重定向到https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxc7290663e60b3a23&redirect_uri=http%3A%2F%2Fantare.fun%2Fweixin%2Fauth&response_type=code&scope=snsapi_userinfo&connect_redirect=1&state=STATE#wechat_redirect

之后前端会报跨域问题:

Access to XMLHttpRequest at 'https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxc7290663e60b3a23&redirect_uri=http%3A%2F%2Fantare.fun%2Fweixin%2Fauth&response_type=code&scope=snsapi_userinfo&connect_redirect=1&state=STATE#wechat_redirect' (redirected from 'http://antare.fun/weixin/login') from origin 'null' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.


后端已经配置过跨域,其他接口也都能用

回调域名也在公众号中设置过了

1 回复

有没有人能帮我邀请一下社区运营,我等级不够

回到顶部