fix(upload): 分片用 multipart 字段 chunk、路由顺序与串行上传

- 前端 FormData+chunk,避免 raw body 被中间层断连
- Gin 分片路由置于 POST .../assets 之前
- 分片并发降为 1

Made-with: Cursor
This commit is contained in:
whm
2026-04-14 09:30:09 +08:00
parent cce3d158d5
commit 65574e3762
4 changed files with 43 additions and 8 deletions

View File

@@ -9,7 +9,8 @@ import {
const CHUNK_THRESHOLD = 8 * 1024 * 1024
const DEFAULT_CHUNK_SIZE = 4 * 1024 * 1024
const UPLOAD_CONCURRENCY = 3
// 串行上传分片,避免 HTTP/2 多路复用 + 大 body 在部分反代上不稳定
const UPLOAD_CONCURRENCY = 1
function fileFingerprint(file) {
return `${file.name}\t${file.size}\t${file.lastModified}`