From eb6ec92ae033bb87b166ef5bee6c475e201d2986 Mon Sep 17 00:00:00 2001 From: chenruilong Date: Wed, 24 Aug 2022 15:25:31 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=99uni-id-co=E4=B8=AD=E7=9A=84add-user?= =?UTF-8?q?=E4=BA=91=E5=87=BD=E6=95=B0=E6=B7=BB=E5=8A=A0=E6=89=8B=E6=9C=BA?= =?UTF-8?q?=E5=8F=B7=E3=80=81=E9=82=AE=E7=AE=B1=E7=AD=89=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../uni-id-co/module/admin/add-user.js | 32 +++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/admin/add-user.js b/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/admin/add-user.js index 988ee5b..c682147 100644 --- a/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/admin/add-user.js +++ b/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/admin/add-user.js @@ -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' + }, + mobile: { + required: false, + type: 'mobile' + }, + email: { + required: false, + type: 'email' + }, + tags: { + required: false, + type: 'array' + }, + 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 { -- GitLab