提交 bbcd1233 编写于 作者: DCloud_JSON's avatar DCloud_JSON

更新uni-id-co

上级 36491053
......@@ -366,7 +366,7 @@ class Validator {
schemaKey
}
} else {
delete value[schemaKey]
//delete value[schemaKey]
continue
}
}
......
......@@ -92,7 +92,7 @@ module.exports = async function (params = {}) {
const realData = Object.keys(data).reduce((res, key) => {
const item = data[key]
if (item) {
if (item !== undefined) {
res[key] = item
}
return res
......@@ -114,7 +114,6 @@ module.exports = async function (params = {}) {
}
}
}
if (password) {
const passwordUtils = new PasswordUtils({
clientInfo: this.getUniversalClientInfo(),
......@@ -127,12 +126,13 @@ module.exports = async function (params = {}) {
password
})
data.password = passwordHash
data.password_secret_version = version
realData.password = passwordHash
realData.password_secret_version = version
}
await userCollection.doc(uid).update(realData)
return {
errCode: 0
}
......
......@@ -95,7 +95,7 @@ module.exports = async function (params = {}) {
const getDeviceRes = await deviceCollection.where({
device_id: deviceId
}).get()
console.log(getDeviceRes)
// console.log(getDeviceRes)
if (getDeviceRes.data.length > 1) {
return {
errCode: ERROR.SYSTEM_ERROR
......
......@@ -7,7 +7,7 @@
"author": "DCloud",
"dependencies": {
"jsonwebtoken": "8.5.1",
"lodash.merge": "^4.6.2",
"lodash.merge": "4.6.2",
"uni-captcha": "file:../../../../uni-captcha/uniCloud/cloudfunctions/common/uni-captcha",
"uni-config-center": "file:../../../../uni-config-center/uniCloud/cloudfunctions/common/uni-config-center",
"uni-id-common": "file:../../../../uni-id-common/uniCloud/cloudfunctions/common/uni-id-common",
......
......@@ -209,7 +209,7 @@
"title": "昵称",
"trim": "both",
"permission": {
"read": true,
"read": "doc._id == auth.uid || 'READ_UNI_ID_USERS' in auth.permission",
"write": "doc._id == auth.uid || 'CREATE_UNI_ID_USERS' in auth.permission || 'UPDATE_UNI_ID_USERS' in auth.permission"
}
},
......@@ -330,6 +330,15 @@
},
"title": "角色"
},
"tags":{
"bsonType": "array",
"description": "用户标签",
"permission": {
"read": "doc._id == auth.uid || 'READ_UNI_ID_USERS' in auth.permission",
"write": "'CREATE_UNI_ID_USERS' in auth.permission || 'UPDATE_UNI_ID_USERS' in auth.permission"
},
"title": "标签"
},
"score": {
"bsonType": "int",
"description": "用户积分,积分变更记录可参考:uni-id-scores表定义",
......@@ -369,7 +378,7 @@
"bsonType": "array",
"description": "用户token",
"permission": {
"read": "'READ_UNI_ID_USERS' in auth.permission",
"read": false,
"write": "'CREATE_UNI_ID_USERS' in auth.permission || 'UPDATE_UNI_ID_USERS' in auth.permission"
}
},
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册