feat: 新增从参数取默认密码

This commit is contained in:
dap 2024-10-08 15:17:18 +08:00
parent a7b8b6efb0
commit 846bab7b7e
2 changed files with 14 additions and 4 deletions

View File

@ -2,8 +2,7 @@
**FEATURES** **FEATURES**
- 基础功能已经开发完毕 - 用户管理 新增从参数取默认密码
- 工作流相关模块等待后端重构后开发
**BUG FIXES** **BUG FIXES**

View File

@ -10,6 +10,7 @@ import { addFullName, cloneDeep, getPopupContainer } from '@vben/utils';
import { Tag } from 'ant-design-vue'; import { Tag } from 'ant-design-vue';
import { useVbenForm } from '#/adapter'; import { useVbenForm } from '#/adapter';
import { configInfoByKey } from '#/api/system/config';
import { postOptionSelect } from '#/api/system/post'; import { postOptionSelect } from '#/api/system/post';
import { import {
findUserInfo, 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({ const [BasicDrawer, drawerApi] = useVbenDrawer({
onCancel: handleCancel, onCancel: handleCancel,
onConfirm: handleConfirm, onConfirm: handleConfirm,
@ -165,8 +176,8 @@ const [BasicDrawer, drawerApi] = useVbenDrawer({
fieldName: 'postIds', fieldName: 'postIds',
}, },
]); ]);
// // &&
await setupDeptSelect(); await Promise.all([setupDeptSelect(), loadDefaultPassword(isUpdate.value)]);
if (user) { if (user) {
await Promise.all([ await Promise.all([
// //