2***@qq.com
2***@qq.com
  • 发布:2024-07-12 15:34
  • 更新:2024-07-12 23:40
  • 阅读:68

报bug:unicloud 联合查询 报错"TOKEN_INVALID_ANONYMOUS_USER"

分类:uniCloud

.vue 部分:
const order = this.db.collection('companyList').where(_id == '${this.companyIdArr.splice(0,1)[0]}').field(
'_id,companyname').getTemp();
const order2 = this.db.collection('user').where(companyId == '${this.companyIdArr.splice(0,1)[0]}').field(
'nickname,deptId,companyId,username,answerlist.score,answerlist.exid,answerlist.title').limit(999)
.getTemp();
this.db.collection(order, order2).get()

companyList.schema.json
"permission": {
"read": true,
"create": true,
"update": true,
"delete": true
}

user.schema.json
"permission": {
"read": true,
"create": true,
"update": true,
"delete": true
}

在JQL调速器没问题,在程序中报错
Error: 权限校验未通过,未能获取当前用户信息,当前用户为匿名身份,参与权限校验的集合:[companyList,user]

2024-07-12 15:34 负责人:无 分享
已邀请:
DCloud_UNI_yuhe

DCloud_UNI_yuhe

你检查一下,user或者companyList里面的一个属性是否单独有设置读写权限

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

    没有设置,全都是放开的,JQL调试器可以正常查询到数据,在程序内就不可以了。

    2024-07-15 09:31

  • DCloud_UNI_yuhe

    回复 2***@qq.com: 你这么说我也不容易复现,你能把你的uniCloud相关文件打包发给我吗?

    2024-07-15 10:07

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

    回复 DCloud_UNI_yuhe: 请看私信,我发给你文件包

    2024-07-15 16:56

2***@qq.com

2***@qq.com (作者)

没有设置,全都是放开的,JQL调试器可以正常查询到数据,在程序内就不可以了。

要回复问题请先登录注册