fix(inspirations): 灵感页 - 修复刷新重定向与面包屑标题 (#731)
This commit is contained in:
@@ -475,6 +475,8 @@ SEO 标题、描述、可选关键词会投影到浏览器 metadata、Open Graph
|
||||
|
||||
工作区左侧「创作」下方新增灵感页 `/inspirations`,展示全部提示词,按来源、分类和创作类型筛选,支持搜索、收藏、视图切换和分页;自建灵感支持新建、编辑、删除和 JSON 导入导出,改动只存在本地。
|
||||
|
||||
生产 Nginx 对 `/inspirations` 与 `/inspirations/` 精确返回 SPA 入口,支持直接打开和刷新;`/inspirations/*.json` 继续提供静态目录数据,避免页面路径与同名目录冲突而跳转到容器端口。
|
||||
|
||||
外部提示词由 `web/scripts/import-inspirations.mjs` 同步:`awesome-seedance`、好好学 AI 提示词库、YouMind 的两个姊妹库。脚本同时为画廊池生成本地缩略图(560px、webp、约 35KB 一张)。上游封面平均 400KB~700KB,直接引用一屏 11 张要拉 5MB 以上,换成本地缩略图后约 400KB。
|
||||
|
||||
画廊池走 `public/inspirations/gallery-pool.json` 运行时拉取,不打进首屏 JS:几百条提示词正文压在包里是白背的,而这份数据只服务画廊一处。池子按来源等距抽取以横跨各分类,并且只收描述非空的条目,保证卡片三行版式不缺角;这些条目仍留在全量目录里供灵感页展示。
|
||||
|
||||
@@ -5,6 +5,14 @@ description: 当前项目已实现功能的手工验证清单与未确认边界
|
||||
|
||||
# 待测试
|
||||
|
||||
## 灵感页路由与导航
|
||||
|
||||
- 已修复:Nginx 对 `/inspirations` 与 `/inspirations/` 精确返回 SPA 入口,避免同名静态目录触发带容器端口的 301;目录下的 JSON 仍按静态文件提供。
|
||||
- 已修复:顶部面包屑补齐灵感路由标题,显示「站点名称 / 灵感」,与侧栏一致,不再回退到站点名称。
|
||||
- [x] 使用生产同版本 Nginx 容器复现旧配置的 301;修改后配置检查通过,两个页面路径及查询参数返回入口文件且无重定向,五个真实 JSON 文件返回原内容和正确类型。该验证只覆盖网关,不替代真实页面验收。
|
||||
- [ ] 更新前端镜像后,通过实际域名直接打开和刷新两个路径,确认不跳转到 `:3000`、不返回 403,且灵感目录正常加载。
|
||||
- [ ] 通过侧栏进入、直接打开及刷新灵感页,确认面包屑显示「灵感」。
|
||||
|
||||
## 画布素材缺失时的本地强制覆盖
|
||||
|
||||
- 已实现:云端保存返回 `canvas_history_resources_missing` 时,画布同步面板提供“用本地版强制覆盖云端”。操作会先保存本地草稿,探测资源状态,清理确认已删除或不存在的资源定位,保留节点布局、提示词和连线后再提交;普通自动保存仍执行完整素材校验。
|
||||
|
||||
11
nginx.conf
11
nginx.conf
@@ -16,7 +16,7 @@ server {
|
||||
client_max_body_size 1024m;
|
||||
access_log /var/log/nginx/access.log canvas_no_query;
|
||||
add_header Referrer-Policy "no-referrer" always;
|
||||
# Also covers exact SPA aliases (/canvas, /assets, /welcome).
|
||||
# Also covers exact SPA aliases (/canvas, /assets, /welcome, /inspirations).
|
||||
add_header Cache-Control "no-cache, must-revalidate" always;
|
||||
gzip on;
|
||||
gzip_comp_level 5;
|
||||
@@ -158,6 +158,15 @@ server {
|
||||
try_files /index.html =404;
|
||||
}
|
||||
|
||||
# /inspirations 同时是 React 路由和灵感 JSON 目录;页面入口不能按静态目录重定向。
|
||||
location = /inspirations {
|
||||
try_files /index.html =404;
|
||||
}
|
||||
|
||||
location = /inspirations/ {
|
||||
try_files /index.html =404;
|
||||
}
|
||||
|
||||
location / {
|
||||
try_files $uri $uri/ /index.html;
|
||||
}
|
||||
|
||||
@@ -15,6 +15,7 @@ import { openWorkspaceWallet } from "@/lib/workspace-wallet";
|
||||
const PAGE_TITLES: Record<string, string> = {
|
||||
home: "创作",
|
||||
create: "创作",
|
||||
inspirations: "灵感",
|
||||
projects: "短剧 Agent",
|
||||
canvas: "自由画布",
|
||||
tasks: "创作历史",
|
||||
|
||||
Reference in New Issue
Block a user