From 846bab7b7e90cc9bfe6c65ea3bff7dd39a9ca3db Mon Sep 17 00:00:00 2001 From: dap <15891557205@163.com> Date: Tue, 8 Oct 2024 15:17:18 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9E=E4=BB=8E=E5=8F=82?= =?UTF-8?q?=E6=95=B0=E5=8F=96=E9=BB=98=E8=AE=A4=E5=AF=86=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 3 +-- .../src/views/system/user/user-drawer.vue | 15 +++++++++++++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 756eb995..c2d123c1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,8 +2,7 @@ **FEATURES** -- 基础功能已经开发完毕 -- 工作流相关模块等待后端重构后开发 +- 用户管理 新增从参数取默认密码 **BUG FIXES** diff --git a/apps/web-antd/src/views/system/user/user-drawer.vue b/apps/web-antd/src/views/system/user/user-drawer.vue index 1882d5b6..9a1e7348 100644 --- a/apps/web-antd/src/views/system/user/user-drawer.vue +++ b/apps/web-antd/src/views/system/user/user-drawer.vue @@ -10,6 +10,7 @@ import { addFullName, cloneDeep, getPopupContainer } from '@vben/utils'; import { Tag } from 'ant-design-vue'; import { useVbenForm } from '#/adapter'; +import { configInfoByKey } from '#/api/system/config'; import { postOptionSelect } from '#/api/system/post'; import { findUserInfo, @@ -113,6 +114,16 @@ async function setupDeptSelect() { ]); } +/** + * 新增时候 从参数设置获取默认密码 + */ +async function loadDefaultPassword(update: boolean) { + if (!update) { + const defaultPassword = await configInfoByKey('sys.user.initPassword'); + defaultPassword && formApi.setFieldValue('password', defaultPassword); + } +} + const [BasicDrawer, drawerApi] = useVbenDrawer({ onCancel: handleCancel, onConfirm: handleConfirm, @@ -165,8 +176,8 @@ const [BasicDrawer, drawerApi] = useVbenDrawer({ fieldName: 'postIds', }, ]); - // 部门选择 - await setupDeptSelect(); + // 部门选择 && 初始密码 + await Promise.all([setupDeptSelect(), loadDefaultPassword(isUpdate.value)]); if (user) { await Promise.all([ // 添加基础信息