fix: 修复重新导入的模块数缺失、名称被覆盖与 URL 抓取报错

- 项目详情接口 _count 漏 select modules,重新导入弹框因此显示「undefined 个模块」
- 重新导入不再用文档中的 name/description 覆盖用户自行设置的项目名称与描述
- URL 抓取失败原因此前被完全吞掉,只剩无信息量的 502:前端改为预判混合内容、
  跳过必然超时的内网服务端代理、直连加超时,并抛出带错误码的 SpecFetchError
- 服务端代理加 15s 超时并始终返回 JSON,不再挂到 nginx 超时返回 HTML 错误页
- 新增 SpecFetchErrorNotice 组件,跨域类失败时可展开具体的 CORS 配置引导
- nginx /api/ 补 client_max_body_size 12m,避免大文档在 nginx 层被 413 挡掉

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
2026-09-17 11:00:22 +08:00
parent 65e4e6778d
commit 0e163e02ed
11 changed files with 254 additions and 39 deletions

View File

@@ -4,6 +4,9 @@ server {
index index.html;
location /api/ {
# OpenAPI 文档整份提交,默认 1m 上限会被大文档打爆server 侧允许 10mb
client_max_body_size 12m;
proxy_read_timeout 120s;
proxy_pass http://server:3000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;