pc微信端调用小程序获取电话接口错误?
发布于 3 年前 作者 chaozhang 2590 次浏览 来自 问答

小程序云函数获取电话。手机使用小程序正常,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

1 回复

看下云函数返回结果,自己帮自己

回到顶部