可以在微信开发工具:公众号网页调试
然后查看授权登录接口是否有错误信息:
查看错误操作方法: https://doc.crmeb.com/pro/crmebprov2/2372?search=%E9%94%99%E8%AF%AF
常见错误如下:
appid不能为空
1、检查公众号配置
⚠️:ip白名单一定要配置
2、排除缓存影响
可以根据文档操作: https://doc.crmeb.com/pro/crmebprov2/2370?search=%E4%B8%8D%E7%94%9F%E6%95%88
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、在开发工具选公众号网页模式
查看是否能正常授权
如果能,手机端不能,则清楚手机微信缓存在尝试