提交 1d62674b 编写于 作者: C chenruilong

fix(uni-id-co): 手机号与邮箱验证规则为空字符串时不校验

上级 89489173
......@@ -81,15 +81,23 @@ module.exports = async function (params = {}) {
// 更新的用户数据字段
const data = {
username,
dcloud_appid: authorizedApp || [],
dcloud_appid: authorizedApp,
nickname,
role: role || [],
role: role,
mobile,
email,
tags: tags || [],
tags: tags,
status
}
const realData = Object.keys(data).reduce((res, key) => {
const item = data[key]
if (item) {
res[key] = item
}
return res
}, {})
// 更新用户名时验证用户名是否重新
if (username) {
const {
......@@ -123,7 +131,7 @@ module.exports = async function (params = {}) {
data.password_secret_version = version
}
await userCollection.doc(uid).update(data)
await userCollection.doc(uid).update(realData)
return {
errCode: 0
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册