统一前端错误读取和调试日志

This commit is contained in:
yml2213
2026-06-10 15:52:49 +08:00
parent df7d6a2675
commit 70a35204b3
40 changed files with 110 additions and 233 deletions
@@ -1,3 +1,4 @@
import { readError } from '@/shared/utils/error'
import { onUnmounted, ref } from 'vue'
import { showToast } from 'vant'
import { sendSmsCode } from '@/features/auth/api/auth'
@@ -51,13 +52,6 @@ export function useSmsCountdown() {
}
}
function readError(error: unknown, fallback: string) {
if (typeof error === 'object' && error && 'response' in error) {
const response = (error as { response?: { data?: { message?: string } } }).response
return response?.data?.message || fallback
}
return fallback
}
return {
countDown,