{{wikiTitle}}
公众号登录失败问题
目录:
公众号登录失败
常见错误如下:
appid不能为空
redirect_uri 域名与后配置不一致10003注意⚠️:最好用php7.4版本
如果是7.3、7.2 7.2
请查看帖子,先替换文件,在排查
https://www.crmeb.com/ask/thread/13015
1、检查公众号配置
⚠️:ip白名单一定要配置
2、排除缓存影响
3、可以在浏览器访问:https://你的域名/api/wechat/config?url=https://你的域名
(1)查看接口是否正常返回(是有参数数据返回的),返回url参数是否是你的域名,如下:
{"status":200,"msg":"ok","data":{"debug":false,"beta":true,"jsApiList":["openAddress","updateTimelineShareData","updateAppMessageShareData","onMenuShareTimeline","onMenuShareAppMessage","onMenuShareQQ","onMenuShareWeibo","onMenuShareQZone","startRecord","stopRecord","onVoiceRecordEnd","playVoice","pauseVoice","stopVoice","onVoicePlayEnd","uploadVoice","downloadVoice","chooseImage","previewImage","uploadImage","downloadImage","translateVoice","getNetworkType","openLocation","getLocation","hideOptionMenu","showOptionMenu","hideMenuItems","showMenuItems","hideAllNonBaseMenuItem","showAllNonBaseMenuItem","closeWindow","scanQRCode","chooseWXPay","openProductSpecificView","addCard","chooseCard","openCard"],"openTagList":[],"appId":"公众号APPID","nonceStr":"0EjJPGLkLq","timestamp":1660785666,"url":"https:\/\/pro.crmeb.net","signature":"4a962caabc1055acf3b9eea76b9334b6766a7782"}}
(2)有配置异常返回结果如下:
{"status":200,"msg":"ok","data":[]}
排查方法:
文件:项目根目录/crmeb/services/wechat/OfficialAccount.php
如下图所示部分:
写入log日志,可以比较清楚的知道微信配置是哪里有问题
4、在开发工具选公众号网页模式
查看是否能正常授权
如果能,手机端不能,则清楚手机微信缓存在尝试
{{cateWiki.like_num}}人点赞
0人点赞
评论({{cateWiki.comment_num}})
{{commentWhere.order ? '评论从旧到新':'评论从新到旧'}}
{{cateWiki.page_view_num}}人看过该文档
评论(0)
{{commentWhere.order ? '评论从旧到新':'评论从新到旧'}}
87人看过该文档
{{item.user ? item.user.nickname : ''}} (自评)
{{item.content}}
{{item.create_time}} 删除
{{item.like ? item.like.like_num : 0}}
{{replyIndex == index ? '取消回复' : '回复'}}
搜索结果
为您找到{{wikiCount}}条结果
位置:{{path.name}} {{(i+1) == item.catalogue.path_data.length ? '':'/'}}
{{item.page_view_num}}
{{item.like ? item.like.like_num : 0}}
{{item.comment ? item.comment.comment_num : 0}}