Files
Pre_Seg_Server/工程分析/需求分析-20260429_231526.md

22 lines
991 B
Markdown
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.
# 需求分析 — 2026-04-28
## 问题背景
用户报告三个活跃 Bug
1. 上传后显示 `undefined`(字段名不匹配)
2. React StrictMode 下 WebSocket 断开报错
3. 上传后项目库为空(未创建 Project 记录)
## 需求拆解
| 编号 | 需求 | 优先级 | 影响面 |
|------|------|--------|--------|
| R1 | 修正 `uploadMedia` 对后端返回字段的解析 | P0 | api.ts |
| R2 | 修正 `uploadMedia` 返回值结构 | P0 | api.ts + 调用方 |
| R3 | 在 upload 成功后自动刷新项目列表 | P0 | ProjectLibrary.tsx |
| R4 | 修复 WebSocket `disconnect()` 在 CONNECTING 状态调用 `.close()` 崩溃 | P0 | websocket.ts |
| R5 | 修复 StrictMode 下 cleanup 函数二次调用导致的竞态 | P1 | Dashboard.tsx + websocket.ts |
## 验收标准
- 上传成功后在控制台打印正确 URL不再出现 `undefined`
- WebSocket 连接/断开循环不再抛出 `InvalidStateError`
- 上传完成后项目列表自动刷新并显示新项目