统一前端错误读取和调试日志
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user