云函数的调用为什么返回结果是userInfo?
发布于 7 年前 作者 daitao 808 次浏览 来自 官方Issues

我有一个云函数`getOpenID`, 如下,

exports.main = (event, context) => {

  const { OPENID, APPID } = cloud.getWXContext() // 这里获取到的 openId 和 appId 是可信的
  return {
    OPENID,
    APPID
  }
}

然后调用该云函数

wx.cloud.callFunction({
  name'getOpenID'
  }).then(res => {
    console.log(res);
  })

 

返回的数据确实这样的 ? 和我定义的返回结果完全不一样 ??? 谁能帮忙解释下 ?

然后我开云函数本地调试, 他就返回正常了 ? 麻烦谁能解答一下 ??

1 回复

没有上传吧,把你的函数增量上传一下

回到顶部