From d894349479c28ff7cc352ff4a672b51e9ac50375 Mon Sep 17 00:00:00 2001 From: zhongzm Date: Tue, 29 Apr 2025 10:51:09 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E4=BF=AE=E6=94=B9=E5=AF=86=E7=A0=81?= =?UTF-8?q?=E6=8F=90=E7=A4=BA=E4=BF=A1=E6=81=AF=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/static/resetpwd/index.vue | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/views/static/resetpwd/index.vue b/src/views/static/resetpwd/index.vue index 601824b..3578852 100644 --- a/src/views/static/resetpwd/index.vue +++ b/src/views/static/resetpwd/index.vue @@ -88,30 +88,32 @@ const emailFormRef = ref(); const pwdFormRef = ref(); const handleSubmit = async () => { - try { + if (resetType.value === 'email') { await emailFormRef.value?.validate(); const hide = message.loading(t('common.loading'), 0); - await resetPassword({ + const { error }= await resetPassword({ email: emailFormData.email, code: emailFormData.code, password: emailFormData.password }); + if(!error) { + message.success(t('page.resetPwd.success')); + } hide(); } else { await pwdFormRef.value?.validate(); const hide = message.loading(t('common.loading'), 0); - await updatePasswordByOld({ + const{ error }= await updatePasswordByOld({ oldPassword: pwdFormData.oldPassword, newPassword: pwdFormData.newPassword }); + if(!error) { + message.success(t('page.resetPwd.success')); + } hide(); } - - message.success(t('page.resetPwd.success')); routerPushByKey('login'); - } catch (error) { - } };