@@ -191,12 +191,16 @@ const getCode = async () => {
|
||||
if (!isEmailEmpty()) return
|
||||
if (!isEmailVerified(email.value)) return
|
||||
|
||||
await commonApi.sendMailCaptcha(email.value)
|
||||
uni.showToast({
|
||||
title: t('login.sendCodeSuccess'),
|
||||
icon: 'none'
|
||||
})
|
||||
getCodeState()
|
||||
try {
|
||||
await commonApi.sendMailCaptcha(email.value)
|
||||
uni.showToast({
|
||||
title: t('login.sendCodeSuccess'),
|
||||
icon: 'none'
|
||||
})
|
||||
getCodeState()
|
||||
} catch (error) {
|
||||
console.error('Send code error:', error)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -260,16 +264,20 @@ const onSubmit = async () => {
|
||||
if (!isConfirmPasswordEmpty()) return
|
||||
if (!isPasswordMatch()) return
|
||||
|
||||
await resetPassword(email.value, code.value, password.value)
|
||||
try {
|
||||
await resetPassword(email.value, code.value, password.value)
|
||||
|
||||
uni.showModal({
|
||||
title: t('global.tips'),
|
||||
content: t('forget.passwordChanged'),
|
||||
showCancel: false,
|
||||
success: () => {
|
||||
uni.navigateBack()
|
||||
}
|
||||
})
|
||||
uni.showModal({
|
||||
title: t('global.tips'),
|
||||
content: t('forget.passwordChanged'),
|
||||
showCancel: false,
|
||||
success: () => {
|
||||
uni.navigateBack()
|
||||
}
|
||||
})
|
||||
} catch (error) {
|
||||
console.error('Reset password error:', error)
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user