8***@qq.com
8***@qq.com
  • 发布:2022-07-04 20:28
  • 更新:2022-07-05 20:23
  • 阅读:733

【报Bug】this.getClientInfo is not a function

分类:uniCloud

产品分类: uniCloud/App

示例代码:

async get(id, idFocus) {
const dbJQL = uniCloud.databaseForJQL({
clientInfo: this.getClientInfo()
})
},

const userFocus = module.exports = {
async add(id, idFocus) {
let res = await userFocus.get()
}
}

操作步骤:

云对象add方法调用自身get方法或者get方法调用自身,报错this.getClientInfo is not a function。

预期结果:

正常访问

实际结果:

报错

bug描述:

云对象使用jql语法的报错。是我写法有什么问题吗?

2022-07-04 20:28 负责人:无 分享
已邀请:
DCloud_uniCloud_WYQ

DCloud_uniCloud_WYQ

你这样调用会改变对应方法里面的this,如果有公共逻辑单独拿出来就行,不要这样使用方法互调

  • 8***@qq.com (作者)

    好吧

    2022-07-06 11:03

  • 1***@qq.com

    什么意思,getClientInfo现在是不是用不了了,在云函数中一直报错this.getClientInfo is not a function

    2023-11-23 15:10

要回复问题请先登录注册