refactor(frontend): split large reimbursement and audit modules

This commit is contained in:
caoxiaozhu
2026-05-21 23:53:03 +08:00
parent 2908dda024
commit f6f787ff38
53 changed files with 15637 additions and 14179 deletions

View File

@@ -269,7 +269,9 @@ export async function apiRequest(path, options = {}) {
globalThis.clearTimeout(timeoutId)
}
if (error?.name === 'AbortError') {
throw new Error(String(timeoutMessage || '').trim() || '接口请求超时,请稍后重试。')
const timeoutError = new Error(String(timeoutMessage || '').trim() || '接口请求超时,请稍后重试。')
timeoutError.code = 'REQUEST_TIMEOUT'
throw timeoutError
}
if (String(error?.message || '').includes('ByteString')) {
throw new Error('当前登录用户信息包含浏览器不支持的请求头字符,请重新登录后重试。')

View File

@@ -1,5 +1,8 @@
import { apiRequest } from './api.js'
export function fetchBackendHealth() {
return apiRequest('/health')
export function fetchBackendHealth(options = {}) {
return apiRequest('/health', {
timeoutMs: Number(options.timeoutMs || 2500),
timeoutMessage: '后端健康检查超时,可能正在处理耗时任务。'
})
}