表结构
{
"bsonType": "object",
"permission": {
"read": true,
"create": true,
"update": true,
"delete": true
}
}
module.exports = {
_before: function() {
this.token = this.getHttpInfo().headers.token
const clientInfo = this.getClientInfo()
this.uniID = uniID.createInstance({
clientInfo
})
},
async addAddress() {
const data = JSON.parse(this.getHttpInfo().body)
const payload = this.uniID.checkToken(this.token)
const result = await uniCloud.databaseForJQL({
clientInfo: this.getClientInfo()
}).collection('yjs-address').add(data)
return result
}
}
我控制台是看了payload没有问题。是有uid的。
我的云端schema和本地schema增删改查权限全都是true。
不明白为什么访问数据库的时候未能获取当前用户信息。
求大佬帮解答
9***@qq.com (作者)
已解决,感谢
2025-07-02 14:32