小程序云函数获取电话。手机使用小程序正常,pc微信使用小程序报错。
云函数:
wx.cloud.callFunction({
name: ‘login’,
data: {weRunData: wx.cloud.CloudID(e.detail.cloudID)}
}).then(res => {
console.log(“res=”,res)
console.log(“phone===”+res.result.weRunData.data.phoneNumber
})
手机正常,pc使用报错。
(in promise) MiniProgramError
undefined is not an object (evaluating ‘e.result.weRunData.data.phoneNumber’)
https://usr/app-service.js:5128:539
https://lib/WAService.js:2:66120
https://lib/WAService.js:2:66228
A@https://lib/WAService.js:2:68681
https://lib/WAService.js:2:32899
n@https://lib/WAService.js:2:32598
C@https://lib/WAService.js:2:121540
https://lib/WAService.js:2:122361
https://lib/WAService.js:2:114291
_onNativeTimer
global code