微信登录失败 appid不能为空,错误码:10012

发布时间:2023年12月18日

原因:微信公众号未配置或者小程序未配置
解决方法:

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"}}

Copy

(2)有配置异常返回结果如下:

{"status":200,"msg":"ok","data":[]}

Copy

排查方法:

文件:项目根目录/crmeb/services/wechat/OfficialAccount.php
如下图所示部分:
?


写入log日志,可以比较清楚的知道微信配置是哪里有问题

4、在开发工具选公众号网页模式

查看是否能正常授权

如果能,手机端不能,则清楚手机微信缓存在尝试

文章来源:https://blog.csdn.net/luxiaol/article/details/135059978
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。