fix(phase-5.2): 消项 CR 第二轮 P1/P2/P3(通道/证据链/交付时序/后管证据页)

This commit is contained in:
2026-10-31 21:12:18 +08:00
parent a4e4456b50
commit 91d36327f9
61 changed files with 2833 additions and 311 deletions
@@ -9,6 +9,7 @@
import type { DesktopConfig, DesktopConfigUpdate, PywebviewApi } from './pywebview'
import { extractErrorMessage, http } from '@/shared/api/http'
import { uploadTimeoutForBytes } from '@/shared/api/upload.ts'
/**
* 虚拟路径 → 浏览器 File 对象(虚拟路径仅存活于当前页面会话,刷新即失效)
@@ -240,7 +241,10 @@ export const webFallbackApi: PywebviewApi = {
}
try {
// http 实例对 /newApi 前缀自动附带 Bearer;FormData 的 Content-Type 交由浏览器自动生成(含 boundary)
const response = await http.post('/newApi/api/files/upload', form, { timeout: 120000 })
// 超时按体积给(P3-5:与 upload.ts 同一把尺),几 MB 的 xlsx/zip 不再被固定 120s 掐死
const response = await http.post('/newApi/api/files/upload', form, {
timeout: uploadTimeoutForBytes(file.size),
})
// 消费完即释放:文件已落到服务端,页面后续只用返回的 fileKey/url,不再需要这份本地 File。
// 失败分支保留条目,让用户能在不重新选文件的情况下重试(超量时由 rememberWebFile 的 FIFO 淘汰兜底)。
if (response.data?.success) {