常見錯誤如下:
appid不能為空
redirect _url協議與后臺配置不一致
注意??:最好用php7.4版本
如果是7.3、7.2 7.2
請查看帖子,先替換文件,在排查
https://www.www.2233z.cn/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、在開發工具選公眾號網頁模式
查看是否能正常授權
如果能,手機端不能,則清楚手機微信緩存在嘗試