DB schema中配置:
"permission": {
"read": true,
"create": "'CREATE_UNI_ID_USERS' in auth.permission",
"update": "doc._id == auth.uid || 'UPDATE_UNI_ID_USERS' in auth.permission",
"delete": "'DELETE_UNI_ID_USERS' in auth.permission"
}
......
"wx_openid": {
"bsonType": "object",
"description": "微信各个平台openid",
"properties": {
"app": {
"bsonType": "string",
"description": "app平台微信openid"
},
"mp": {
"bsonType": "string",
"description": "微信小程序平台openid"
},
"h5": {
"bsonType": "string",
"description": "微信公众号登录openid"
},
"web": {
"bsonType": "string",
"description": "PC页面扫码登录openid"
}
},
"permission": {
"read": true,
"write": true
}
}
云对象中部分代码:
const dbJQL = uniCloud.databaseForJQL({
clientInfo: this.getClientInfo()
})
let dbRes = await dbJQL.collection("uni-id-users").where({
'wx_openid.mp': openid
}).get();
提示错误:
12:51:24.065 [本地调试]Error: 权限校验未通过,未能获取当前用户信息,当前用户为匿名身份,请参考文档:https://uniapp.dcloud.net.cn/uniCloud/schema.html#handler-permission-error
12:51:24.065 [本地调试] at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
是什么原因?
1***@qq.com (作者)
收到,感谢!!!
2025-05-22 22:07