3,159
社区成员
发帖
与我相关
我的任务
分享
<script>
var appid = "wxdf6b300ee49243f2";
var redirect_uri = encodeURIComponent(window.location.href);
var scope = "snsapi_login";
var url = "https://open.weixin.qq.com/connect/qrconnect?appid=" + appid + "&redirect_uri=" + redirect_uri + "&response_type=code&scope=" + scope + "&state=1#wechat_redirect";
window.location.href = url;
</script>

大佬们 ,我这个为什么会无法访问,回调域是正确的呀!
最后终于解决了,我一直以为是我账号有问题,看到很多人都遇到这个问题。
需要注意两个地方就好了:
1、授权回调域,只填写域名就可以;(域名前不要加http://、https://等协议)
2、REDIRECT_URI,回调地址必须是填写的授权回调域下的地址;(不要忘记加http://、https://等协议)
做好了,祈祷吧。

修改一下授权回调域就可以了
改成例如:http://www.baidu.com ,不要在后面加http://www.baidu.com/weixinlogin/return等