fix:重置密码界面接通
This commit is contained in:
@@ -13,6 +13,7 @@ import {
|
||||
Radio,
|
||||
} from 'ant-design-vue';
|
||||
import { useRouter } from 'vue-router';
|
||||
import { resetPassword } from '@/service/api/auth';
|
||||
|
||||
const AInputPassword = Input.Password;
|
||||
const ARadioGroup = Radio.Group;
|
||||
@@ -98,10 +99,23 @@ async function handleCaptcha() {
|
||||
async function handleSubmit() {
|
||||
try {
|
||||
await formRef.value?.validate();
|
||||
//
|
||||
window.$message?.success(t('common.success'));
|
||||
|
||||
if (resetType.value === 'password') {
|
||||
// 通过原密码重置
|
||||
await resetPassword({
|
||||
oldPassword: formModel.oldPassword,
|
||||
newPassword: formModel.password
|
||||
});
|
||||
} else {
|
||||
// TODO: 通过邮箱验证码重置的接口
|
||||
}
|
||||
|
||||
window.$message?.success(t('page.login.resetPwd.resetSuccess'));
|
||||
// 重置成功后返回个人信息页面
|
||||
router.push('/userInfo/usercard');
|
||||
} catch (error) {
|
||||
console.error('Form validation failed:', error);
|
||||
console.error('Reset password failed:', error);
|
||||
window.$message?.error(t('page.login.resetPwd.resetFailed'));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -123,7 +137,7 @@ const handleBack = () => {
|
||||
|
||||
<a-radio-group v-model:value="resetType" class="mb-24px">
|
||||
<a-radio value="password">{{ t('page.login.resetPwd.byPassword') }}</a-radio>
|
||||
<a-radio value="email">{{ t('page.login.resetPwd.byEmail') }}</a-radio>
|
||||
<!-- <a-radio value="email">{{ t('page.login.resetPwd.byEmail') }}</a-radio>-->
|
||||
</a-radio-group>
|
||||
|
||||
<a-form
|
||||
|
||||
Reference in New Issue
Block a user