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 988ee5b8e01457a6c11197c96b239dd59d6aff1f..c6821478475c48b2a8af3a79195b2ced13062f5d 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 {