|
|
@@ -59,7 +59,7 @@ import { ref } from 'vue'
|
|
|
import { useRouter } from 'vue-router'
|
|
|
import { showToast } from 'vant'
|
|
|
import { useAuthStore } from '@/stores/auth'
|
|
|
-import { BizError } from '@/api/client'
|
|
|
+import { PortalError } from '@/api/portalClient'
|
|
|
|
|
|
const router = useRouter()
|
|
|
const auth = useAuthStore()
|
|
|
@@ -81,9 +81,14 @@ async function handleLogin() {
|
|
|
showToast('登录成功')
|
|
|
router.replace('/')
|
|
|
} catch (e: any) {
|
|
|
- const detail = e?.response?.data?.detail || e?.response?.data?.msg || ''
|
|
|
+ const detail =
|
|
|
+ e?.response?.data?.message ||
|
|
|
+ e?.response?.data?.msg ||
|
|
|
+ e?.response?.data?.detail ||
|
|
|
+ ''
|
|
|
errorText.value = detail || e.message || '账号或密码错误'
|
|
|
- if (!(e instanceof BizError)) {
|
|
|
+ // PortalError:拦截器已 toast,避免双提示
|
|
|
+ if (!(e instanceof PortalError)) {
|
|
|
showToast(errorText.value)
|
|
|
}
|
|
|
} finally {
|