优化:请求接口全局处理loading和错误提示
This commit is contained in:
@@ -285,13 +285,8 @@ const verifyCodeLogin = async () => {
|
||||
|
||||
if (!isCodeEmpty()) return false
|
||||
|
||||
try {
|
||||
const res = await loginWithCode(email.value, code.value)
|
||||
return res
|
||||
} catch (error) {
|
||||
console.error('验证码登录失败:', error)
|
||||
return null
|
||||
}
|
||||
const res = await loginWithCode(email.value, code.value)
|
||||
return res || null
|
||||
}
|
||||
// 密码登录
|
||||
const passwordLogin = async () => {
|
||||
@@ -301,13 +296,8 @@ const passwordLogin = async () => {
|
||||
|
||||
if (!isPasswordEmpty()) return false
|
||||
|
||||
try {
|
||||
const res = await loginWithPassword(phoneEmail.value, password.value)
|
||||
return res
|
||||
} catch (error) {
|
||||
console.error('密码登录失败:', error)
|
||||
return null
|
||||
}
|
||||
const res = await loginWithPassword(phoneEmail.value, password.value)
|
||||
return res || null
|
||||
}
|
||||
// 提交登录
|
||||
const onSubmit = async () => {
|
||||
|
||||
Reference in New Issue
Block a user