feat:修改密码提示信息修复
This commit is contained in:
@@ -88,30 +88,32 @@ const emailFormRef = ref();
|
|||||||
const pwdFormRef = ref();
|
const pwdFormRef = ref();
|
||||||
|
|
||||||
const handleSubmit = async () => {
|
const handleSubmit = async () => {
|
||||||
try {
|
|
||||||
if (resetType.value === 'email') {
|
if (resetType.value === 'email') {
|
||||||
await emailFormRef.value?.validate();
|
await emailFormRef.value?.validate();
|
||||||
const hide = message.loading(t('common.loading'), 0);
|
const hide = message.loading(t('common.loading'), 0);
|
||||||
await resetPassword({
|
const { error }= await resetPassword({
|
||||||
email: emailFormData.email,
|
email: emailFormData.email,
|
||||||
code: emailFormData.code,
|
code: emailFormData.code,
|
||||||
password: emailFormData.password
|
password: emailFormData.password
|
||||||
});
|
});
|
||||||
|
if(!error) {
|
||||||
|
message.success(t('page.resetPwd.success'));
|
||||||
|
}
|
||||||
hide();
|
hide();
|
||||||
} else {
|
} else {
|
||||||
await pwdFormRef.value?.validate();
|
await pwdFormRef.value?.validate();
|
||||||
const hide = message.loading(t('common.loading'), 0);
|
const hide = message.loading(t('common.loading'), 0);
|
||||||
await updatePasswordByOld({
|
const{ error }= await updatePasswordByOld({
|
||||||
oldPassword: pwdFormData.oldPassword,
|
oldPassword: pwdFormData.oldPassword,
|
||||||
newPassword: pwdFormData.newPassword
|
newPassword: pwdFormData.newPassword
|
||||||
});
|
});
|
||||||
|
if(!error) {
|
||||||
|
message.success(t('page.resetPwd.success'));
|
||||||
|
}
|
||||||
hide();
|
hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
message.success(t('page.resetPwd.success'));
|
|
||||||
routerPushByKey('login');
|
routerPushByKey('login');
|
||||||
} catch (error) {
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user