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

更新uni-id-co

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