2
0

feat:增加修改密码后的提示

This commit is contained in:
zhongzm
2025-02-15 14:35:00 +08:00
parent 93579c7dde
commit f92107dbbb
3 changed files with 15 additions and 7 deletions

View File

@@ -270,7 +270,8 @@ const local: any = {
usernameFormatError: 'Username can only contain letters, numbers and underscore', usernameFormatError: 'Username can only contain letters, numbers and underscore',
usernameStartWithLetter: 'Username must start with a letter', usernameStartWithLetter: 'Username must start with a letter',
usernameExists: 'Username already exists', usernameExists: 'Username already exists',
validationError: 'Validation failed, please try again' validationError: 'Validation failed, please try again',
passwordFormat:'The password needs to have letters or numbers',
}, },
resetPwd: { resetPwd: {
title: 'Reset Password', title: 'Reset Password',

View File

@@ -270,7 +270,8 @@ const local:any = {
usernameFormatError: '用户名只能包含字母、数字和下划线', usernameFormatError: '用户名只能包含字母、数字和下划线',
usernameStartWithLetter: '用户名必须以字母开头', usernameStartWithLetter: '用户名必须以字母开头',
usernameExists: '该用户名已被使用', usernameExists: '该用户名已被使用',
validationError: '验证失败,请重试' validationError: '验证失败,请重试',
passwordFormat:'密码需要有字母或数字',
}, },
resetPwd: { resetPwd: {
title: '重置密码', title: '重置密码',

View File

@@ -10,7 +10,7 @@ import {
Input, Input,
Button as AButton, Button as AButton,
Card as ACard, Card as ACard,
Radio, Radio, message,
} from 'ant-design-vue'; } from 'ant-design-vue';
import { useRouter } from 'vue-router'; import { useRouter } from 'vue-router';
import { resetPassword, resetPasswordByEmail } from '@/service/api/auth'; import { resetPassword, resetPasswordByEmail } from '@/service/api/auth';
@@ -132,13 +132,19 @@ async function handleSubmit() {
password: formModel.password password: formModel.password
}); });
} }
message.success({
content: t('page.login.resetPwd.resetSuccess'),
duration: 2
});
window.$message?.success(t('page.login.resetPwd.resetSuccess')); // 延迟跳转
// 重置成功后返回个人信息页面 setTimeout(() => {
router.push('/userInfo/usercard'); router.push('/userInfo/usercard');
}, 2000);
} catch (error) { } catch (error) {
console.error('Reset password failed:', error); console.error('Reset password failed:', error);
window.$message?.error(t('page.login.resetPwd.resetFailed')); message.error(t('page.login.resetPwd.resetFailed'));
} }
} }