Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
hello_uni-id-pages
提交
eb6ec92a
H
hello_uni-id-pages
项目概览
DCloud
/
hello_uni-id-pages
通知
1040
Star
30
Fork
42
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
3
列表
看板
标记
里程碑
合并请求
1
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
H
hello_uni-id-pages
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
3
Issue
3
列表
看板
标记
里程碑
合并请求
1
合并请求
1
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
eb6ec92a
编写于
8月 24, 2022
作者:
C
chenruilong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
给uni-id-co中的add-user云函数添加手机号、邮箱等字段
上级
d2de1fff
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
30 addition
and
2 deletion
+30
-2
uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/admin/add-user.js
...niCloud/cloudfunctions/uni-id-co/module/admin/add-user.js
+30
-2
未找到文件。
uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/admin/add-user.js
浏览文件 @
eb6ec92a
...
...
@@ -18,6 +18,10 @@ const PasswordUtils = require('../../lib/utils/password')
* @param {String} params.nickname 昵称
* @param {Array} params.authorizedApp 允许登录的AppID列表
* @param {Array} params.role 用户角色列表
* @param {String} params.mobile 手机号
* @param {String} params.email 邮箱
* @param {Array} params.tags 用户标签
* @param {Number} params.status 用户状态
* @returns
*/
module
.
exports
=
async
function
(
params
=
{})
{
...
...
@@ -35,6 +39,22 @@ module.exports = async function (params = {}) {
role
:
{
require
:
false
,
type
:
'
array<string>
'
},
mobile
:
{
required
:
false
,
type
:
'
mobile
'
},
email
:
{
required
:
false
,
type
:
'
email
'
},
tags
:
{
required
:
false
,
type
:
'
array<string>
'
},
status
:
{
required
:
false
,
type
:
'
number
'
}
}
this
.
middleware
.
validate
(
params
,
schema
)
...
...
@@ -43,7 +63,11 @@ module.exports = async function (params = {}) {
password
,
authorizedApp
,
nickname
,
role
role
,
mobile
,
email
,
tags
,
status
}
=
params
const
userMatched
=
await
findUser
({
userQuery
:
{
...
...
@@ -72,7 +96,11 @@ module.exports = async function (params = {}) {
password_secret_version
:
version
,
dcloud_appid
:
authorizedApp
||
[],
nickname
,
role
:
role
||
[]
role
:
role
||
[],
mobile
,
email
,
tags
:
tags
||
[],
status
})
return
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录