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) {
var url= `/system/user/profile/updatePwd?oldPassword=${pwdJson.oldPassword}&newPassword=${pwdJson.newPassword}`;
return request({ url, method: 'put'});
var url= `/system/user/resetPwd`;
return request({ url, method: 'put',data:pwdJson });
}

View File

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

View File

@@ -176,8 +176,8 @@ let modalState: any = reactive({
title: '用户',
from: {
userName: '',
newPassword: '',
oldPassword: '',
password: '',
userId:'',
},
confirmLoading: false,
});
@@ -186,20 +186,13 @@ let modalState: any = reactive({
const modalStateFrom = Form.useForm(
modalState.from,
reactive({
newPassword: [
password: [
{
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'),
},
],
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,
duration: 2,
});
modalState.openByResetPwd = false;
modalStateFrom.resetFields();
}
getData();
})
@@ -246,6 +241,7 @@ function fnModalOkResetPwd(){
*/
function fnRecordResetPwd(row: Record<string, string>) {
modalStateFrom.resetFields();
modalState.from.userId = row.userId;
modalState.from.userName = row.userName;
modalState.title = $t('page.login.resetPwd.title');
modalState.openByResetPwd = true;
@@ -321,7 +317,6 @@ function fnModalOkResetPwd(){
<a-form-item
:label="$t('page.manage.user.userName')"
name="userName"
v-bind="modalStateFrom.validateInfos.userName"
>
<a-input :value="modalState.from.userName" disabled :maxlength="30">
<template #prefix>
@@ -330,12 +325,12 @@ function fnModalOkResetPwd(){
</a-input>
</a-form-item>
<a-form-item
:label="$t('page.login.register.oldPassword')"
:label="$t('page.login.register.password')"
name="password"
v-bind="modalStateFrom.validateInfos.oldPassword"
v-bind="modalStateFrom.validateInfos.password"
>
<a-input-password
v-model:value="modalState.from.oldPassword"
v-model:value="modalState.from.password"
:maxlength="26"
>
<template #prefix>
@@ -343,21 +338,6 @@ function fnModalOkResetPwd(){
</template>
</a-input-password>
</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-modal>