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

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,4 +1,5 @@
import { ref, type Ref } from 'vue'
import { debugError } from '@/shared/utils/debug'
interface AdminQueryOptions<T> {
fetchFn: () => Promise<T>
@@ -25,7 +26,7 @@ export function useAdminQuery<T>(options: AdminQueryOptions<T>): AdminQueryResul
data.value = await options.fetchFn()
} catch (e) {
error.value = e instanceof Error ? e.message : '加载失败'
console.error('Failed to load data:', e)
debugError('加载后台表格数据失败', e)
} finally {
loading.value = false
}