gongxiangp2/components/upload/upload-constants.ts
chenpei cd6e40d9d2 优化:网络传输性能和稳定性 - TCP缓冲区+并发控制优化
主要改动:
1. TCP缓冲区优化(16MB)- 解决公网上传速度慢问题
2. 并发数降低到1-3 - 避免4并发导致ERR_CONNECTION_RESET
3. 动态并发控制 - 根据网络环境自动调整
4. Nginx超时增加到120s - 支持大分片上传
5. 上传进度修复 - 修复剩余时间计算
6. 新增任务-页面上传器和详情组件
7. 统一部署文档为deploy-remote-build.ps1

问题修复:
- 公网用户上传从200-900KB/s提升到预期3-5MB/s
- 内网用户上传更稳定,无连接重置错误
- UploadProgress组件剩余时间计算修正

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-27 09:33:09 +08:00

38 lines
918 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// 上传相关的常量定义
// 预览图可选的类型列表
export const PREVIEW_OPTIONAL_TYPES: string[] = [
'详情模板',
'模特',
'任务-实拍原图',
'买家秀图片',
'小红书种草',
'主图模版',
// 'SKU模版', // 已移除:SKU模版现在必须上传预览图
'品牌VI灵感',
'主图视频',
'安装视频',
'种草视频',
'音乐',
]
// 上传后需自动填充"通用"店铺/场景的类型(从统一验证库导出以保持一致性)
export { AUTO_GENERAL_TYPES } from '@/lib/material-validation'
// 批量上传限制
export const BATCH_LIMITS = {
music: 100,
video: 8,
'3d': 5,
brandVI: 50,
buyerShow: Infinity, // 每批至少8张图
xiaohongshu: Infinity,
} as const
// 主文件超过 5MB 走分片上传,确保弱网/大文件稳定性
export const CHUNK_THRESHOLD = 5 * 1024 * 1024
// 最大重试次数
export const MAX_RETRY = 2