2
0

修改重置密码界面

This commit is contained in:
lai
2025-02-19 14:22:27 +08:00
parent 8729c2d1f7
commit 5561d924ab
3 changed files with 13 additions and 33 deletions

View File

@@ -62,8 +62,8 @@ export function doGetUserDeptTree() {
} }
export function doUpdatePwd(pwdJson: any) { export function doUpdatePwd(pwdJson: any) {
var url= `/system/user/profile/updatePwd?oldPassword=${pwdJson.oldPassword}&newPassword=${pwdJson.newPassword}`; var url= `/system/user/resetPwd`;
return request({ url, method: 'put'}); return request({ url, method: 'put',data:pwdJson });
} }

View File

@@ -21,7 +21,7 @@ getCheckCode();
const model = reactive({ const model = reactive({
username: 'admin', username: 'admin',
password: 'admin123', password: 'Admin123.',
code: '', code: '',
uuid: '', uuid: '',
authType: 'sys' authType: 'sys'

View File

@@ -176,8 +176,8 @@ let modalState: any = reactive({
title: '用户', title: '用户',
from: { from: {
userName: '', userName: '',
newPassword: '', password: '',
oldPassword: '', userId:'',
}, },
confirmLoading: false, confirmLoading: false,
}); });
@@ -186,20 +186,13 @@ let modalState: any = reactive({
const modalStateFrom = Form.useForm( const modalStateFrom = Form.useForm(
modalState.from, modalState.from,
reactive({ reactive({
newPassword: [ password: [
{ {
required: true, required: true,
pattern: /^(?![A-Za-z0-9]+$)(?![a-z0-9\W]+$)(?![A-Za-z\W]+$)(?![A-Z0-9\W]+$)[a-zA-Z0-9\W]{6,}$/, pattern: /^(?![A-Za-z0-9]+$)(?![a-z0-9\W]+$)(?![A-Za-z\W]+$)(?![A-Z0-9\W]+$)[a-zA-Z0-9\W]{6,}$/,
message: $t('form.pwd.invalid'), message: $t('form.pwd.invalid'),
}, },
], ]
oldPassword: [
{
required: true,
pattern: /^(?![A-Za-z0-9]+$)(?![a-z0-9\W]+$)(?![A-Za-z\W]+$)(?![A-Z0-9\W]+$)[a-zA-Z0-9\W]{6,}$/,
message: $t('form.pwd.invalid'),
},
],
}) })
); );
@@ -219,6 +212,8 @@ function fnModalOkResetPwd(){
key, key,
duration: 2, duration: 2,
}); });
modalState.openByResetPwd = false;
modalStateFrom.resetFields();
} }
getData(); getData();
}) })
@@ -246,6 +241,7 @@ function fnModalOkResetPwd(){
*/ */
function fnRecordResetPwd(row: Record<string, string>) { function fnRecordResetPwd(row: Record<string, string>) {
modalStateFrom.resetFields(); modalStateFrom.resetFields();
modalState.from.userId = row.userId;
modalState.from.userName = row.userName; modalState.from.userName = row.userName;
modalState.title = $t('page.login.resetPwd.title'); modalState.title = $t('page.login.resetPwd.title');
modalState.openByResetPwd = true; modalState.openByResetPwd = true;
@@ -321,7 +317,6 @@ function fnModalOkResetPwd(){
<a-form-item <a-form-item
:label="$t('page.manage.user.userName')" :label="$t('page.manage.user.userName')"
name="userName" name="userName"
v-bind="modalStateFrom.validateInfos.userName"
> >
<a-input :value="modalState.from.userName" disabled :maxlength="30"> <a-input :value="modalState.from.userName" disabled :maxlength="30">
<template #prefix> <template #prefix>
@@ -330,12 +325,12 @@ function fnModalOkResetPwd(){
</a-input> </a-input>
</a-form-item> </a-form-item>
<a-form-item <a-form-item
:label="$t('page.login.register.oldPassword')" :label="$t('page.login.register.password')"
name="password" name="password"
v-bind="modalStateFrom.validateInfos.oldPassword" v-bind="modalStateFrom.validateInfos.password"
> >
<a-input-password <a-input-password
v-model:value="modalState.from.oldPassword" v-model:value="modalState.from.password"
:maxlength="26" :maxlength="26"
> >
<template #prefix> <template #prefix>
@@ -343,21 +338,6 @@ function fnModalOkResetPwd(){
</template> </template>
</a-input-password> </a-input-password>
</a-form-item> </a-form-item>
<a-form-item
:label="$t('page.login.register.newPassword')"
name="password"
v-bind="modalStateFrom.validateInfos.newPassword"
>
<a-input-password
v-model:value="modalState.from.newPassword"
:maxlength="26"
>
<template #prefix>
<LockOutlined />
</template>
</a-input-password>
</a-form-item>
</a-form> </a-form>
</a-modal> </a-modal>