优化:请求接口全局处理loading和错误提示

This commit is contained in:
2025-11-26 16:37:47 +08:00
24 changed files with 568 additions and 771 deletions

View File

@@ -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 () => {