实现微信账号一键登录功能,看到日志里面,有少量getUserInfo的error,看上去是getOpenData的参数错误。
真机模拟的时候显示空白,暂时没有捕捉到,特发帖求助。
问题现象大概描述如下:
1、手机号A真机登录时,会报这个error
2、将A的微信号添加到开发账号组里,模拟器登录,正常
3、再用真机登录,正常
{"msg":"ERROR RequestId:59db81e4-bcfd-11ea-97d0-5254000f125d Result:{\"errCode\":1,\"errMsg\":\"user code exception caught\",\"stackTrace\":\"Error: errCode: -1 unknown error | errMsg: getOpenData:fail TypeError [ERR_INVALID_ARG_TYPE]: The \\\"string\\\" argument must be one of type string, Buffer, or ArrayBuffer. Received type undefined; at getOpenData api; \\n at returnAsCloudSDKError (/var/user/node_modules/wx-server-sdk/index.js:6032:16)\\n at Object.returnAsFinalCloudSDKError (/var/user/node_modules/wx-server-sdk/index.js:6046:15)\\n at Promise (/var/user/node_modules/wx-server-sdk/index.js:1929:39)\\n at new Promise (\\u003canonymous\\u003e)\\n at Cloud.getOpenData (/var/user/node_modules/wx-server-sdk/index.js:1865:16)\\n at Object.args [as getOpenData] (/var/user/node_modules/wx-server-sdk/index.js:120:29)\\n at getCellPhone (/var/user/index.js:27:32)\\n at Runtime.exports.main [as handler] (/var/user/index.js:14:14)\\n at Runtime.handleOnce (/var/runtime/node10/Runtime.engine.js:193:23)\\n at Timeout.setTimeout [as _onTimeout] (/var/runtime/node10/Runtime.engine.js:43:12)\"}","level":"error","src":"app","requestId":"59db81e4-bcfd-11ea-97d0-5254000f125d","function":"getUserInfo","timestamp":"1593760690884290"}
这个问题,苹果手机都存在,并且是偶现,官方解决了吗?
你好,麻烦提供出现问题的具体机型、微信版本号、系统版本号,以及能复现问题的代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)
预计是下面这段报错
const wxData = await cloud.getOpenData({
list: [event.cloudID],
})