perf:获取短信验证码功能增加try/catch
This commit is contained in:
parent
f9cc24e84c
commit
63ee93a94b
@ -130,6 +130,7 @@ const getSMSCode = async () => {
|
|||||||
SMSCodeNumber.value = 60
|
SMSCodeNumber.value = 60
|
||||||
const { getFormData } = methods
|
const { getFormData } = methods
|
||||||
const formData = await getFormData<UserLoginType>()
|
const formData = await getFormData<UserLoginType>()
|
||||||
|
try {
|
||||||
const res = await postSMSCodeApi({ telephone: formData.telephone })
|
const res = await postSMSCodeApi({ telephone: formData.telephone })
|
||||||
if (res?.data) {
|
if (res?.data) {
|
||||||
let timer = setInterval(() => {
|
let timer = setInterval(() => {
|
||||||
@ -143,6 +144,9 @@ const getSMSCode = async () => {
|
|||||||
ElMessage.error('发送失败,请联系管理员')
|
ElMessage.error('发送失败,请联系管理员')
|
||||||
SMSCodeStatus.value = true
|
SMSCodeStatus.value = true
|
||||||
}
|
}
|
||||||
|
} catch (e: any) {
|
||||||
|
SMSCodeStatus.value = true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user