Web 端本地缓存、首页与会员弹窗体验优化

新增 IndexedDB 与最近文件 L1 缓存、云保存/打开链路;首页支持下载与清空本地缓存;修复清空 storage 后语言初始化报错;优化 design2 背景加载与侧栏标签样式;完善会员激活/支付弹层样式;后端补充文件缩略图字段与 thumb 接口。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
24kycj
2026-06-11 11:05:44 +08:00
parent 877fd278c2
commit 4ce4486b26
33 changed files with 3190 additions and 1143 deletions
+5 -2
View File
@@ -168,7 +168,8 @@ GET /api/v1/pay/orders?page=1&size=8
| `GET /api/v1/templates` | 首页模板列表(仅 `id/name/type/updated_at`;缩略图按需拉取) |
| `GET /api/v1/templates/{id}` | 模板 JSON 数据(门户标准读取端点,见下) |
| `GET /api/v1/templates/{id}/thumb` | 模板缩略图(从 `.soon``frontDisplayPic` 提取) |
| `GET /api/v1/templates/{id}/file` | **legacy**:裸 `.soon` 流;门户禁止调用,仅供兼容 |
| `GET /api/v1/templates/{id}/file` | `.soon` 流(`Cache-Control: max-age=86400`);门户读缓存首选 |
| `GET /api/v1/files/{id}/thumb` | 云文件缩略图(需登录;从 `.soon``frontDisplayPic` 提取) |
| `GET /api/v1/soon-models` | 兼容别名,同 `GET /api/v1/templates` |
#### `GET /api/v1/templates/{id}`(门户读取模板数据)
@@ -196,10 +197,11 @@ GET /api/v1/pay/orders?page=1&size=8
| 前缀 | 含义 | readJsonFile | 保存 writeFile |
|------|------|--------------|----------------|
| `soondesign_file:{id}:v{ver}` | 云端已登记文件 | `GET /files/{id}` | `PUT /files/{id}` |
| `soondesign_template:{id}` | 云端模板(只读源) | `GET /templates/{id}` | `POST /files`(首次保存新建) |
| `soondesign_template:{id}` | 云端模板(只读源) | `GET /templates/{id}/file` | `POST /files`(首次保存新建) |
| `soondesign_session:...` | 本地/临时会话 | sessionStorage | 已登录 `POST /files`;未登录写 session |
- **保存/打开**走 JSON API**仅**首页「下载」走 `GET /files/{id}/download` 落盘 `.soon`
- 门户**读缓存**与最近文件本地优先策略见 [`WEB-LOCAL-CACHE.md`](WEB-LOCAL-CACHE.md);模板首次加载推荐 `GET /templates/{id}/file`(流式 `.soon`,避免 `GET /templates/{id}` 二次包装)
---
@@ -236,3 +238,4 @@ GET /api/v1/pay/orders?page=1&size=8
|------|------|
| 2026-06-08 | 初版:统一 page/size/totalfiles 兼容 limit/offsetpay/orders 分页 |
| 2026-06-08 | 新增 GET /templates/{id} JSON 契约;Web 虚拟 key 前缀;/file 标 legacy |
| 2026-06-08 | 新增 GET /files/{id}/thumbfiles list 增 `has_thumb`;模板 /file 长缓存 |