chore: sync develop → main (PR#94 素材库修复 + 前端优化) #96
Reference in New Issue
Block a user
Delete Branch "develop"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
将 develop 最新变更同步到 main,包含:
Bug A: GeneratePage 引用已删除的 editPlans API(/edit-plans/auto-generate 不存在) - 新增 createGenerationTask 到 tasks.ts(USE_MOCK 模式,待后端适配扁平化架构后切换) - GeneratePage 改用 createGenerationTask 替代 autoGenerateEditPlan - 移除对 @/api/editPlans 的引用 附带修复: window.location.href → useNavigate('/history')- L150: detail=f"读取文件失败: {exc}" → detail="文件读取失败,请稍后重试" - L162: detail=f"文件上传失败: {exc}" → detail="文件上传失败,请稍后重试" - 添加 logger.error 记录完整异常信息供内部排查- FastAPI 初始化添加 redirect_slashes=False,避免反向代理后 307 重定向 URL 丢失 HTTPS 协议 - 移除 titles.py/voices.py/generation_tasks.py 路由中的尾斜杠 ('/' → '','/tasks/' → '/tasks','/tasks/{id}/results/' → '/tasks/{id}/results') Fixes: 前端调用 POST /api/v1/titles 等接口时 307 重定向到 http:// 导致失败根因:前端发送 { content, category } 但后端 CreateTitleLibraryRequest 期望 { name (必填), text (必填), category }。字段名不匹配导致 Pydantic 校验失败返回 422,modal 不关闭,数据不保存。 修复: - api/titles.ts: 请求时将 content 映射为 text + 自动截取 name - api/titles.ts: 响应时将后端 text 字段映射回前端 content - api/titles.ts: updateTitle 改用 PUT(后端实际方法) - 页面代码无需改动,映射在 API 层透明处理 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>