微信小程序获取手机号登录,提示“获取第三方账号失败”
1、从微信小程序后台获取了 APPID 和 APPSCRETE
2、在 uni modules/uni-config-center/uniCloud/cloudfunctions/common/uni-config-center/uni-id/config.json 配置了
3、在manifest.json - 【微信小程序配置】填写了从微信小程序后台获取的 APPID
4、点击工具栏上的 【运行】-【运行到小程序模拟器】-【微信开发者工具】,启动微信开发者工具
5、清空【微信开发者工具】-【清除模拟器缓存】-【清除项目文件列表缓存】-【全部清除】
6、在模拟器中 点击 【微信授权手机号登录】,提示【获取第三方账号失败】
7、使用的是 【连接云端云函数】,查看unicloud 云端控制台 【云函数运行日志】提示如下:
请求入参: {
"args": {
"method": "loginByWeixinMobile",
"params": [
{
"phoneCode": "13324f02ea2c9add2a80defca9858cef752d1bad6241fd5cc954cbf9022fdc37"
}
],
"clientInfo": {
"PLATFORM": "mp-weixin",
"OS": "ios",
"APPID": "UNI0C00AF5",
"DEVICEID": "16835109199129025069",
"scene": 1001,
"windowWidth": 375,
"windowHeight": 730,
"deviceOrientation": "portrait",
"screenWidth": 375,
"screenHeight": 812,
"benchmarkLevel": 1,
"batteryLevel": 100,
"statusBarHeight": 44,
"bluetoothEnabled": true,
"locationEnabled": true,
"wifiEnabled": true,
"cameraAuthorized": true,
"locationAuthorized": true,
"microphoneAuthorized": true,
"notificationAuthorized": true,
"safeArea": {
"top": 44,
"left": 0,
"right": 375,
"bottom": 778,
"width": 375,
"height": 734
},
"enableDebug": false,
"devicePixelRatio": 3,
"mode": "default",
"deviceId": "16835109199129025069",
"safeAreaInsets": {
"top": 44,
"left": 0,
"right": 0,
"bottom": 34
},
"appId": "UNI0C00AF5",
"appName": "***",
"appVersion": "",
"appVersionCode": "100",
"appLanguage": "zh-Hans",
"uniCompileVersion": "3.7.11",
"uniRuntimeVersion": "3.7.11",
"uniPlatform": "mp-weixin",
"deviceBrand": "devtools",
"deviceModel": "iPhone X",
"deviceType": "phone",
"osName": "ios",
"osVersion": "10.0.1",
"hostVersion": "8.0.5",
"hostLanguage": "zh-CN",
"hostName": "WeChat",
"hostSDKVersion": "2.31.1",
"hostFontSizeSetting": 16,
"windowTop": 0,
"windowBottom": 0,
"locale": "zh-Hans",
"LOCALE": "zh-Hans"
}
},
"requestId": "ac1cc3051683513141025197714"
}
[uni-id-co/ac1cc3051683513141025197714/337ms/ERROR] invalid appid hint: [PEDcJHnre-DBg0eA] rid: 64585f35-0d74a02b-31cf918c
Error: invalid appid hint: [PEDcJHnre-DBg0eA] rid: 64585f35-0d74a02b-31cf918c
at generateApiResult (/tmp/function/lib/third-party/weixin/normalize.js:10:11)
at callWxOpenApi (/tmp/function/lib/third-party/weixin/normalize.js:73:5)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:189:7)
请求响应状态: success