Compare commits

...
Author SHA1 Message Date
que01 015947f8fb feat: 增加生产数据库每日备份与状态门禁
CI / Browser smoke (pull_request) Successful in 50s
CI / Static checks (pull_request) Successful in 52s
CI / API integration (pull_request) Successful in 1m23s
CI / Production build (pull_request) Successful in 1m48s
2026-10-23 17:54:27 +08:00
que01 072a1037ac Merge pull request 'ci: 预热 Prisma 并移除运行时 Node 下载' (#7) from ci/avoid-runtime-downloads into main
CI / Browser smoke (push) Has been skipped
CI / Static checks (push) Successful in 53s
CI / Production build (push) Successful in 1m49s
CI / API integration (push) Successful in 1m23s
2026-10-23 09:41:33 +00:00
que01 447c224fce ci: 预热 Prisma 并移除运行时 Node 下载
CI / Static checks (pull_request) Successful in 1m1s
CI / API integration (pull_request) Successful in 1m26s
CI / Production build (pull_request) Successful in 1m45s
CI / Browser smoke (pull_request) Successful in 50s
2026-10-23 17:37:48 +08:00
que01 f2fc1e0810 Merge pull request 'fix: 修复 runner 迁移后的部署状态检查' (#6) from fix/deploy-status-after-runner-migration into main
CI / Browser smoke (push) Has been skipped
CI / API integration (push) Failing after 5m0s
CI / Static checks (push) Failing after 8m4s
CI / Production build (push) Has been skipped
2026-10-23 09:16:08 +00:00
que01 12a3bf2f3b fix: 修复 runner 迁移后的部署状态检查
CI / Static checks (pull_request) Successful in 1m34s
CI / Browser smoke (pull_request) Successful in 1m43s
CI / API integration (pull_request) Successful in 2m21s
CI / Production build (pull_request) Successful in 4m1s
2026-10-23 16:59:26 +08:00
que01 ca6d1712bd Merge pull request 'ci: 迁移本地 runner 并优化并行检查' (#5) from ci/local-runner-parallel into main
CI / Browser smoke (push) Has been skipped
CI / Static checks (push) Successful in 1m26s
CI / API integration (push) Successful in 2m1s
CI / Production build (push) Successful in 2m21s
2026-10-23 08:34:58 +00:00
que01 e7ef0b3ce5 ci: 允许 runner 挂载共享 pnpm store
CI / Static checks (pull_request) Successful in 2m31s
CI / Browser smoke (pull_request) Successful in 1m46s
CI / Production build (pull_request) Successful in 2m25s
CI / API integration (pull_request) Successful in 10m56s
2026-10-23 16:10:49 +08:00
que01 b82aa12875 ci: 共享 pnpm store 加速本地 runner 2026-10-23 16:09:25 +08:00
que01 b43b6f2785 ci: 预构建 runner 镜像并预装 Playwright 依赖
CI / Static checks (pull_request) Successful in 1m49s
CI / Browser smoke (pull_request) Has been cancelled
CI / API integration (pull_request) Has been cancelled
CI / Production build (pull_request) Successful in 2m38s
2026-10-23 15:52:24 +08:00
que01 965dd10219 ci: 迁移本地 runner 并优化并行检查 2026-10-23 15:40:50 +08:00
que01 371689484e Merge pull request 'fix/react-dev-warnings' (#3) from fix/react-dev-warnings into main
CI / Static checks (push) Successful in 6m15s
CI / Production build (push) Successful in 6m1s
CI / Browser smoke (push) Has been skipped
CI / API integration (push) Successful in 3m47s
Reviewed-on: #3
2026-10-23 06:37:36 +00:00
que01 d923b8cea9 fix: 修复内存限流存储异步签名
CI / Static checks (pull_request) Successful in 6m32s
CI / Production build (pull_request) Successful in 5m53s
CI / API integration (pull_request) Has been cancelled
CI / Browser smoke (pull_request) Has been cancelled
2026-10-23 14:35:55 +08:00
que01 a1b29cedee fix: 忽略空图片并收紧预览警告断言 2026-10-23 14:32:01 +08:00
que01 34504c0b44 fix: 清理后台开发态 React 警告 2026-10-23 14:25:56 +08:00
que01 3af5611da5 fix: 收紧发布环境与任务文件边界 2026-10-23 12:57:15 +08:00
que01 2fe108d66a feat: 支持多实例客户端异常限流 2026-10-23 12:57:06 +08:00
que01 4cd3749806 refactor: 缓存后台请求级权限校验 2026-10-23 12:56:57 +08:00
que01 00aeaa3cb1 refactor: 拆分后台可视化编辑器 2026-10-23 12:56:48 +08:00
que01 b190f2758a docs: 记录后台客户端异常上报限流边界 2026-10-23 12:26:53 +08:00
que01 4d9c84defc fix: 生产环境拒绝占位 SESSION_SECRET 2026-10-23 12:26:45 +08:00
que01 b4e3e86dcd refactor: 拆分模板工作区服务并统一后台访问控制 2026-10-23 12:26:37 +08:00
que01 5051839986 Merge pull request 'test: 修复浏览器回归 fixture 契约漂移' (#2) from fix/browser-contract-fixtures into main
CI / Static checks (push) Successful in 5m45s
CI / API integration (push) Successful in 3m35s
CI / Production build (push) Successful in 5m41s
CI / Browser smoke (push) Has been skipped
Reviewed-on: #2
2026-10-21 08:42:41 +00:00
que01 84522a8908 test: 修复浏览器回归 fixture 契约漂移
CI / Static checks (pull_request) Successful in 5m52s
CI / Production build (pull_request) Successful in 5m35s
CI / Browser smoke (pull_request) Successful in 3m0s
CI / API integration (pull_request) Successful in 3m41s
- 补齐 trust content 与模板版本 fixture 的必填字段\n- mock template-operations/failures 的完整响应结构\n- 补全完整浏览器回归的启动步骤与 CORS 要求\n\n完整回归 32 个用例全部通过。
2026-10-21 16:37:31 +08:00
que01 18bcdbeb00 ci: 增加 PR 浏览器 smoke (#1)
CI / Static checks (push) Successful in 5m49s
CI / Production build (push) Successful in 5m44s
CI / Browser smoke (push) Has been skipped
CI / API integration (push) Successful in 3m36s
2026-10-21 07:49:43 +00:00
que01 040504774d fix: 补齐证据哈希与 runner 安装脚本边界
CI / Static checks (push) Successful in 5m44s
CI / Production build (push) Successful in 5m34s
CI / API integration (push) Successful in 3m44s
2026-10-21 14:43:16 +08:00
que01 1001c43af6 chore: 提供可复现的 CI runner 安装脚本
CI / Production build (push) Has been cancelled
CI / API integration (push) Has been cancelled
CI / Static checks (push) Has been cancelled
2026-10-21 14:41:47 +08:00
que01 121148f6cf fix: 修正 deploy:status 远程脚本执行并检查 runner 2026-10-21 14:41:39 +08:00
que01 a08a2f0f98 ci: 让 main 的必需检查始终上报 2026-10-21 14:41:31 +08:00
que01 669d4a7de6 chore: 收敛模板证据哈希并接入提交钩子 2026-10-21 14:41:23 +08:00
que01 ec0cf78d69 chore: 更新模板完成证据源码哈希
CI / Static checks (push) Successful in 5m41s
CI / Production build (push) Successful in 5m36s
CI / API integration (push) Successful in 3m40s
2026-10-21 14:14:04 +08:00
que01 658c94a4e9 docs: 修正 CI 缓存放行网段与日志级别说明 2026-10-21 14:14:04 +08:00
que01 261a33a5ca chore: 更新模板完成证据源码哈希
CI / Static checks (push) Successful in 11m39s
CI / API integration (push) Successful in 3m46s
CI / Production build (push) Successful in 7m38s
2026-10-21 13:40:47 +08:00
que01 f28332f49a docs: 记录 Gitea Actions 首次完整通过 2026-10-21 13:40:46 +08:00
que01 c33c9cbd63 chore: 更新模板完成证据源码哈希
CI / API integration (push) Successful in 9m44s
CI / Static checks (push) Successful in 11m48s
CI / Production build (push) Successful in 11m40s
2026-10-21 13:03:46 +08:00
que01 b742fc70b5 fix: API 集成测试先构建工作区依赖 2026-10-21 13:03:46 +08:00
que01 6bd91d5ee8 chore: 更新模板完成证据源码哈希
CI / Static checks (push) Successful in 12m18s
CI / Production build (push) Successful in 11m41s
CI / API integration (push) Failing after 4m38s
2026-10-21 12:30:46 +08:00
que01 cdc7b407bc fix: 补充 arm64 Prisma 查询引擎目标 2026-10-21 12:30:46 +08:00
que01 9bfa4bb736 chore: 更新模板完成证据源码哈希 2026-10-21 12:29:45 +08:00
que01 c04ab1ef60 fix: API lint 先构建本包以保证脚本类型可解析 2026-10-21 12:29:44 +08:00
que01 4a6bc42635 chore: 更新模板完成证据源码哈希
CI / Static checks (push) Failing after 6m29s
CI / Production build (push) Has been skipped
CI / API integration (push) Has been skipped
2026-10-21 12:17:12 +08:00
que01 b86c661af5 fix: 视觉夹具校验容忍缺失 npm 构建产物 2026-10-21 12:17:11 +08:00
que01 71c068966e chore: 更新模板完成证据源码哈希 2026-10-21 12:16:00 +08:00
que01 784b9cbac8 fix: 缺少 npm 构建产物时模板产物校验只告警 2026-10-21 12:16:00 +08:00
que01 2325214078 chore: 更新模板完成证据源码哈希 2026-10-21 12:11:19 +08:00
que01 e194e605f9 fix: 修复干净环境 lint 与类型检查依赖构建 2026-10-21 12:10:42 +08:00
que01 82381a5e93 chore: 落地 Gitea Actions CI 门禁
CI / Static checks (push) Failing after 5m7s
CI / Production build (push) Has been skipped
CI / API integration (push) Has been skipped
2026-10-21 12:01:40 +08:00
que01 ec6b0dee3e chore: 增加 Gitea Actions runner 冒烟工作流
CI / Runner smoke (push) Successful in 12s
2026-10-21 12:01:04 +08:00
que01 060bad2df0 docs: 更新生产发布状态
CI / Static checks (push) Has been cancelled
CI / Production build (push) Has been skipped
CI / API integration (push) Has been skipped
CI / Taro builds (acheng-campus-food) (push) Has been skipped
CI / Taro builds (atelier-solopreneur) (push) Has been skipped
CI / Taro builds (linjing-editorial) (push) Has been skipped
CI / Browser regression (push) Has been skipped
2026-10-21 11:49:40 +08:00
que01 adcaa12970 feat: 接通后台渲染异常上报与响应契约校验 2026-10-21 11:43:41 +08:00
que01 330d67adc1 docs: 更新生产发布状态
CI / Static checks (push) Has been cancelled
CI / Production build (push) Has been cancelled
CI / API integration (push) Has been cancelled
CI / Taro builds (acheng-campus-food) (push) Has been cancelled
CI / Taro builds (atelier-solopreneur) (push) Has been cancelled
CI / Taro builds (linjing-editorial) (push) Has been cancelled
CI / Browser regression (push) Has been cancelled
2026-10-21 11:06:23 +08:00
que01 737010ea03 fix: 后台外壳容忍异常品牌成员数据
CI / Taro builds (linjing-editorial) (push) Has been cancelled
CI / Browser regression (push) Has been cancelled
CI / Static checks (push) Has been cancelled
CI / Production build (push) Has been cancelled
CI / API integration (push) Has been cancelled
CI / Taro builds (acheng-campus-food) (push) Has been cancelled
CI / Taro builds (atelier-solopreneur) (push) Has been cancelled
2026-10-21 11:03:55 +08:00
que01 ec84988e57 docs: 更新生产发布状态
CI / Static checks (push) Has been cancelled
CI / Production build (push) Has been cancelled
CI / API integration (push) Has been cancelled
CI / Taro builds (acheng-campus-food) (push) Has been cancelled
CI / Taro builds (atelier-solopreneur) (push) Has been cancelled
CI / Taro builds (linjing-editorial) (push) Has been cancelled
CI / Browser regression (push) Has been cancelled
2026-10-21 11:00:37 +08:00
que01 f266bda3a9 test: 覆盖后台渲染异常页面
CI / Taro builds (linjing-editorial) (push) Has been cancelled
CI / Browser regression (push) Has been cancelled
CI / Static checks (push) Has been cancelled
CI / Production build (push) Has been cancelled
CI / API integration (push) Has been cancelled
CI / Taro builds (acheng-campus-food) (push) Has been cancelled
CI / Taro builds (atelier-solopreneur) (push) Has been cancelled
2026-10-21 10:56:51 +08:00
que01 88ab2561bd fix: 增加后台渲染错误边界 2026-10-21 10:56:51 +08:00
que01 98c7701ccd docs: 更新生产发布状态
CI / Static checks (push) Has been cancelled
CI / Production build (push) Has been cancelled
CI / API integration (push) Has been cancelled
CI / Taro builds (acheng-campus-food) (push) Has been cancelled
CI / Taro builds (atelier-solopreneur) (push) Has been cancelled
CI / Taro builds (linjing-editorial) (push) Has been cancelled
CI / Browser regression (push) Has been cancelled
2026-10-21 10:50:14 +08:00
que01 e752a3b7ed docs: 记录发布流程回归覆盖
CI / Static checks (push) Has been cancelled
CI / Production build (push) Has been cancelled
CI / API integration (push) Has been cancelled
CI / Taro builds (acheng-campus-food) (push) Has been cancelled
CI / Taro builds (atelier-solopreneur) (push) Has been cancelled
CI / Taro builds (linjing-editorial) (push) Has been cancelled
CI / Browser regression (push) Has been cancelled
2026-10-21 10:47:38 +08:00
que01 9389235a6c test: 补充发布流程浏览器回归 2026-10-21 10:47:30 +08:00
que01 a293591dba fix: 修正小程序配置表单实例归属 2026-10-21 10:47:30 +08:00
que01 8c5860699f docs: 更新生产发布状态
CI / Taro builds (atelier-solopreneur) (push) Has been cancelled
CI / Taro builds (linjing-editorial) (push) Has been cancelled
CI / Static checks (push) Has been cancelled
CI / Production build (push) Has been cancelled
CI / API integration (push) Has been cancelled
CI / Taro builds (acheng-campus-food) (push) Has been cancelled
CI / Browser regression (push) Has been cancelled
2026-10-21 10:37:36 +08:00
que01 06619a191f refactor: 提示与确认框改用 App 上下文实例
CI / Static checks (push) Has been cancelled
CI / Production build (push) Has been cancelled
CI / API integration (push) Has been cancelled
CI / Taro builds (acheng-campus-food) (push) Has been cancelled
CI / Taro builds (atelier-solopreneur) (push) Has been cancelled
CI / Taro builds (linjing-editorial) (push) Has been cancelled
CI / Browser regression (push) Has been cancelled
2026-10-21 10:34:34 +08:00
que01 3a0099e674 refactor: 迁移 Ant Design 6 弃用的 Alert 与 Space 属性 2026-10-21 10:30:03 +08:00
que01 ca1b873a50 docs: 更新生产发布状态
CI / Taro builds (linjing-editorial) (push) Has been cancelled
CI / Static checks (push) Has been cancelled
CI / Production build (push) Has been cancelled
CI / API integration (push) Has been cancelled
CI / Taro builds (acheng-campus-food) (push) Has been cancelled
CI / Taro builds (atelier-solopreneur) (push) Has been cancelled
CI / Browser regression (push) Has been cancelled
2026-10-21 10:28:25 +08:00
que01 c2bd956b07 docs: 更新项目状态与交付证据
CI / API integration (push) Has been cancelled
CI / Taro builds (acheng-campus-food) (push) Has been cancelled
CI / Taro builds (atelier-solopreneur) (push) Has been cancelled
CI / Taro builds (linjing-editorial) (push) Has been cancelled
CI / Browser regression (push) Has been cancelled
CI / Static checks (push) Has been cancelled
CI / Production build (push) Has been cancelled
2026-10-21 10:22:44 +08:00
que01 b101d169c9 fix: 前置发布构建的 Node 版本门禁 2026-10-21 10:22:44 +08:00
que01 ab17f80607 fix: 修正品牌创建与页面方案交互 2026-10-21 10:22:44 +08:00
que01 6df4e1d72b docs: 补充模板契约发布快照刷新流程
CI / Taro builds (linjing-editorial) (push) Has been cancelled
CI / Browser regression (push) Has been cancelled
CI / Static checks (push) Has been cancelled
CI / Production build (push) Has been cancelled
CI / API integration (push) Has been cancelled
CI / Taro builds (acheng-campus-food) (push) Has been cancelled
CI / Taro builds (atelier-solopreneur) (push) Has been cancelled
2026-10-21 09:02:16 +08:00
que01 cb046a4c27 fix: 支持显式放行遗留字段删除的重发分类 2026-10-21 09:00:05 +08:00
que01 3738be884b chore: 更新模板完成证据源码哈希 2026-10-20 22:25:16 +08:00
que01 193858c727 fix: 增加模板契约发布快照重发工具 2026-10-20 22:14:55 +08:00
que01 ea81c754ed test: 增加发布包运行时预检 2026-10-20 21:24:21 +08:00
que01 16fd827634 fix: 收口发布包完整性与模板契约迁移 2026-10-20 17:59:11 +08:00
que01 38e9d59864 chore: 更新模板完成证据源码哈希 2026-10-20 17:37:34 +08:00
que01 fb072d844b fix: 补齐发布包补丁文件 2026-10-20 17:35:04 +08:00
que01 0d9f4a7d6f refactor: 拆分品牌业务类型与页面方案
CI / Static checks (push) Has been cancelled
CI / Production build (push) Has been cancelled
CI / API integration (push) Has been cancelled
CI / Taro builds (acheng-campus-food) (push) Has been cancelled
CI / Taro builds (atelier-solopreneur) (push) Has been cancelled
CI / Taro builds (linjing-editorial) (push) Has been cancelled
CI / Browser regression (push) Has been cancelled
2026-10-20 17:04:30 +08:00
que01 f02e2cafbb test: 增加 API 路由覆盖门禁 2026-10-19 20:13:47 +08:00
que01 5d88cb2040 test: 补齐 Admin 会话边界回归 2026-10-19 11:35:41 +08:00
que01 8e29932bc6 fix: 修复首次登录会话恢复 2026-10-19 10:58:26 +08:00
que01 4ef4be2071 refactor: 收口 Admin 会话与授权边界 2026-10-19 10:13:13 +08:00
que01 0788480ce3 fix: 收口审查发现的 CI 与授权边界
将 admin identity helper 移到共享边界,清理跨 feature 导入;修复 CI 集成环境、浏览器数据库/Playwright 配置;增强 doctor source hash 对重命名文件的处理,并补充 logout API 文档。
2026-10-19 00:28:37 +08:00
que01 bd129a3069 fix: 收口会话边界与 CI 环境
统一 Admin 会话解析、避免登出未处理异常,补充 admin/customer logout 与品牌切换契约文档;修正 CI integration 缺少数据库/会话环境的问题,并刷新 doctor source hash。
2026-10-19 00:09:39 +08:00
que01 3017e3eb49 fix: 收口依赖兼容与会话撤销
为 miniprogram-ci 和 Jimp 依赖增加兼容 patch 与 smoke test;修复平台模板管理员路由漏配;收紧模板契约校验;为 admin/customer 增加 token 撤销和集中会话存储;同步品牌切换角色、doctor source hash、多屏宽截图证据和 CI 构建门禁。
2026-10-18 23:43:25 +08:00
que01 4f0b50c7f1 fix: 收口模板契约与安全门禁
统一模板包 visual 契约并补齐完成证据;修复 release 版本一致性、管理员 token 撤销、CORS 与默认品牌配置;收敛依赖安全风险并完成全量回归验证。
2026-10-18 22:05:31 +08:00
que01 456171aa85 fix: 收口模板契约迁移预检 2026-10-18 17:45:15 +08:00
que01 50b87e48de refactor: 统一模板契约并修复预览版本 2026-10-18 17:09:09 +08:00
que01 cd2992c00a fix: 修复模板画布点选与保存切页回归 2026-10-18 13:40:01 +08:00
que01 e6d843b4a7 fix: 将模板失败概览操作类别改为中文 2026-10-18 13:40:01 +08:00
que01 5a93d38437 docs: 归档阶段八隔离验收与迁移审查 2026-10-17 22:39:43 +08:00
que01 bba20c5b28 docs: 记录阶段八本地验收证据 2026-10-17 21:37:03 +08:00
que01 b47cf5badc docs: 启动模板真实验收阶段 2026-10-17 21:34:52 +08:00
que01 71c528de34 feat: 收口模板升级与阶段七持续回归 2026-10-17 21:33:57 +08:00
que01 ec16fff70e feat: 收口小程序构建上传阶段 2026-10-17 18:01:38 +08:00
que01 6420b85019 fix: 修复林境模板包预览资源版本 2026-10-17 16:03:47 +08:00
que01 c1633fb6f3 fix: 禁止已撤回模板进入预览 2026-10-17 14:49:05 +08:00
que01 d1958a7d7f feat: 完成模板管理阶段4闭环 2026-10-17 13:56:19 +08:00
que01 b1e8012ded fix: 收口模板预览状态与媒体矩阵 2026-10-16 22:53:05 +08:00
que01 5bf54096be feat: 完成模板预览隔离与矩阵验收 2026-10-16 20:36:57 +08:00
que01 d38dbe02aa feat: 增加模板预览短期隔离上下文 2026-10-16 19:46:38 +08:00
que01 b60174885e feat: 分离模板演示数据并校验预览资源 2026-10-16 17:55:52 +08:00
que01 6edde5a8d6 feat: 增加模板版本独立预览入口 2026-10-16 17:28:07 +08:00
que01 413413efda feat: 完成模板目录导入与生命周期管理 2026-10-16 16:34:24 +08:00
que01 553a07c4ec feat: 增加模板自动一致性校验 2026-10-16 14:12:46 +08:00
que01 cddf836f4f feat: 增加模板确定性打包命令 2026-10-16 14:01:45 +08:00
que01 58370224b5 docs: 固化模板管理现状盘点 2026-10-16 13:43:33 +08:00
que01 b6713ea34c fix: 统一模板包版本与校验 2026-10-16 13:35:18 +08:00
que01 1918dae36b docs: 固化模板管理与分发交付计划 2026-10-16 13:13:12 +08:00
que01 3989fbd39e test: 同步工坊模板审查记录 2026-10-16 11:53:27 +08:00
que01 cfd42e17f8 refactor: 收敛工坊模板页面职责与视觉 2026-10-16 11:40:37 +08:00
que01 f12003004b style: 按设计稿收敛工坊首页视觉 2026-10-16 10:07:46 +08:00
que01 6de7dd8d9e fix: 恢复工坊首页主理人身份卡 2026-10-16 09:26:00 +08:00
que01 0862a4c01d fix: 调整工坊模板第三个Tab为我的 2026-10-16 00:19:23 +08:00
que01 18eb8bb9b0 fix: 安装发布依赖闭包 2026-10-15 23:47:36 +08:00
que01 a933e1feb6 fix: 修复小程序构建进度死锁 2026-10-15 23:42:08 +08:00
que01 f7be18a35e fix: 合并发布依赖安装避免链接丢失 2026-10-15 23:32:26 +08:00
que01 714cbd55f2 fix: 补齐发布包中的 Taro 构建工程 2026-10-15 23:26:04 +08:00
que01 50753db79d fix: 完善工坊模板安装预览与详情样例 2026-10-15 20:58:45 +08:00
que01 5313fd9d32 chore: 合并主分支后台路由修复 2026-10-15 17:50:47 +08:00
que01 34bd8142de fix: 修复后台菜单路由匹配和概览重定向循环 2026-10-15 17:50:30 +08:00
que01 04e42b3a80 feat: 新增独立工坊宣传模板及配置导入验证 2026-10-15 17:44:52 +08:00
que01 bf4bbf81c7 refactor: 拆分管理端入口并优化构建分包 2026-10-15 15:10:21 +08:00
que01 0f6ad8b993 docs: 记录API模块边界决策 2026-10-15 14:59:21 +08:00
que01 2ad009f5c0 refactor: 拆分媒体上传职责并锁定API路由 2026-10-15 14:52:59 +08:00
que01 6f18c67315 refactor: 拆分品牌展示编辑器职责 2026-10-15 14:42:20 +08:00
que01 b23120477f refactor: 拆分后台工作区与API模块 2026-10-15 14:35:16 +08:00
que01 12bc263d3b test: 补充小程序发布服务边界测试 2026-10-15 14:35:16 +08:00
que01 7c0f22ad7a refactor: 拆分小程序发布与后台发布页面职责 2026-10-15 14:20:17 +08:00
que01 8973338c64 fix: 完善记录错误状态与缓存失效策略 2026-10-15 13:58:39 +08:00
que01 476e3d93dd fix: 修复 API 前缀下的管理端鉴权绕过 2026-10-15 13:42:29 +08:00
que01 3ae7b462f5 refactor: 将数据库访问从控制器下沉到服务层 2026-10-14 17:53:49 +08:00
que01 f158f906d5 fix: 修复系统一致性与安全问题 2026-10-14 17:36:46 +08:00
que01 aaeec14733 fix: 保证品牌模板身份不被台账漂移 2026-10-14 16:27:23 +08:00
que01 6073e72940 feat: 收敛行业模板身份为品牌单一真相
- BrandProfile.templateKey 为唯一真相,安装记录降级为同模板的版本台账
- 安装只允许补建当前模板台账,跨行业模板请求返回 400,杜绝身份漂移
- preview 不再强制要求台账存在,台账缺失时以模板目录版本为准
- seed 按品牌身份补齐模板台账,消除「身份有、台账无」
- 记录 ADR 0026
2026-10-14 13:55:54 +08:00
que01 896f3240f9 refactor: 拆分模板治理与咨询表单页面
- /admin/workspace 收敛为「咨询表单与字段」,只做咨询入口表单与高级自定义字段
- 行业模板版本升级/回滚迁入「配置与发布 → 内容发布 → 选择表达方式」
- 移除行业模板安装入口、视觉模板历史与模板组合预览等不可达 UI
- 表单下拉的业务选项改用本品牌后台数据,避免公开接口回退默认品牌导致跨品牌串数据
- 侧栏导航与设计文档同步
2026-10-14 13:55:35 +08:00
que01 7b1e9eee47 fix: 校验咨询表单关联业务并修正发布清单文案
- 关联的业务提供项必须存在且属于当前品牌,非法 id 返回 400 而不是数据库外键错误
- targetType 由 offeringId 推导,允许传 null 改回品牌通用入口
- 业务被停用时在发布准备度里点名说明,避免静默卡住发布
- 发布清单条目改为中性描述,是否达标交给状态标签表达
2026-10-14 13:55:00 +08:00
que01 47d6309cba style: 重做后台页头层级与页面命名
- 页头标题 24px 降到 20px,说明 14px 降到 13px,标题与说明间距 8px 收到 6px
- 页头到主体间距从 24px 提到 32px,与卡片间 16px 拉开层级
- 说明文字增加 880px 最大宽度,长句不再横跨整行
- 页面标题与侧栏导航用词对齐:信任内容、业务提供项、小程序页面、能力插件
- 信任内容页说明文案精简到一行内
- 概览页对象主标题降到 18px,避免与页面标题同级
- design.md 同步字号表、页头规范与导航命名约定
2026-10-14 12:07:33 +08:00
que01 ebab77057a fix: 修复信任内容列表展示问题
- 列表按模板声明的类型顺序排列,与必填清单顺序一致
- 类型标签并入说明行,去掉与类型重复的标签;展示位置改为可读页面名
- 类型未识别时页面名补充中文映射(service/inquiry)
- 无配图时按类型显示线性图标,替换统一的文件图标
- 摘要长文本按前 3 个字段截断,避免单行超长
- 记录行改为顶部对齐,操作按钮垂直居中,行内段落间距交给 gap
- Modal destroyOnClose 迁移到 destroyOnHidden,消除 antd 弃用告警
- 发布必填清单显示同类已配置条数,已配置区块显示总数
2026-10-14 11:47:56 +08:00
que01 3ef46b0aa8 feat: 完善后台设计语言细节
- 统一说明文案层级:Typography.Paragraph 次要文案迁移到 admin-section-description
- 状态色补齐边框与中间调令牌,Alert/错误条/Descriptions 与 StatusTag 同源
- 咨询详情描述列表去表格线,改为键值展示并统一令牌
- 新增 BrandMark,侧栏与登录页标识改用品牌首字
- 信任内容改用列表行,空状态、表格骨架屏、主按钮脏检查落地
- design.md 同步令牌映射、切换控件选型与组件清单
2026-10-14 11:21:31 +08:00
que01 2f26828f09 feat: 统一 Admin 后台设计语言
用中性灰底 + 单一强调色重做后台视觉,并集中到一套令牌:

- 新增 apps/admin/src/lib/theme.ts,通过 ConfigProvider 注入主题令牌
- 新增 apps/admin/src/styles/admin.css 与 AdminSection、MetricCard、StatusTag 组件
- 侧栏改白底浅色并补图标,顶栏改 56px 白底,内容区最大宽 1200px
- 全部页面接入状态标签,antd 原生彩色 Tag 与内联色值清零
- 登录与改密页、加载态骨架屏、错误提示条统一
- brand 页两个 Tab 统一为白卡片容器,消除双标题与宽度不一致

设计规范见 apps/admin/design.md。
2026-10-14 10:54:05 +08:00
que01 bb94d80e13 fix: 修正 H5 按钮高度令牌不生效
共享按钮令牌声明在 app.css 的 page 选择器里,而 H5 渲染树没有 page 元素,导致
var(--brand-button-height) 解析失败、min-height 退化成 auto:H5 预览按钮实际高 38px
(内容撑开),与小程序 88rpx(375px 视口等于 44px)不一致,也违反模板完成度规则的
双端 reset 一致要求。

- 令牌改为同时声明在 page 与 body 上,值仍只写一次;微信端取 page,H5 取 body;
- 新增浏览器守卫,断言首页按钮 min-height 解析为 44px 且实际高度一致;
- 在模板完成度规则中记录该根因,避免声明被挪回单一 page 选择器。

验证:weapp 产物输出 page,body{--brand-button-height:88rpx},H5 输出 page,body{2.2rem};
浏览器实测 375px 视口下 min-height/height 均为 44px,430px 视口为 50.45px,与小程序
rpx 缩放一致;把声明改回 page-only 后守卫按预期失败(Received: "auto"),恢复后 12 项
浏览器回归全部通过;六类产物指纹残留为 0;format、lint、typecheck 通过。
2026-10-13 23:44:12 +08:00
que01 29e5666d74 refactor: 共享按钮尺寸令牌改用中性命名
--taro-button-height / --taro-button-compact-height 是本仓库自有的共享令牌,却借用了
框架名。源码级中性命名比产物替换更彻底,也不会出现源码与产物两套名字,因此改为
--brand-button-height / --brand-button-compact-height,与既有的 brand-button 组件命名一致;
产物遮蔽仍按同一张表处理 Taro 自身的标识符。

验证:weapp 的 app-origin.wxss 输出 page{--brand-button-height:88rpx} 与
button{min-height:var(--brand-button-height)};H5 与后台产物的声明与引用同步改名;
六类产物残留指纹均为 0;H5 预览 11 项浏览器回归通过;遮蔽前后后台产物用生产静态
服务器跑同一套测试,失败内容逐字节一致;format、lint、typecheck 通过。
2026-10-13 23:30:07 +08:00
que01 d34cb182e3 test: 修正首页行动按钮的失效断言
首页行动按钮在 inquiry 能力停用时退化为 Text,H5 端 Button 又渲染为 taro-button-core
自定义元素,两种情况都没有原生 button,因此按标签断言恒为 0。改为按稳定的
.home-action 类名断言,H5 预览的 11 项浏览器回归由 10 通过恢复为全部通过。
2026-10-13 23:18:56 +08:00
que01 4d1cd8f365 feat: 遮蔽后台静态产物中的 Taro 指纹
Traefik 把 wechat.app.que01.top 上除 /api、/media 以外的路径直接转发到 Admin 静态
服务器且没有鉴权,因此 /admin/assets/*.js 可以被任意下载。后台产物里的模板 renderer
glob 路径(packages/template-*/taro/index.tsx)与按钮尺寸令牌(--taro-button-height)
同样暴露技术栈,此前只遮蔽了 Taro 双端产物。

- mask-taro.cjs 增加 admin 目标,覆盖 apps/admin/dist,接入根脚本 build:admin:preview;
- deploy:package 在后台构建后校验 apps/admin/dist,命中指纹即中止打包;
- 补充遮蔽目标测试与文档(ADR 0025、README、部署说明、交付清单)。

验证:后台产物遮蔽后 glob key 与运行时查找同步改名;未遮蔽/已遮蔽产物用生产静态
服务器跑同一套后台浏览器测试,失败内容逐字节一致(既有失败与本改动无关);H5 预览
11 项浏览器回归全部通过;admin 构建、lint、typecheck、deploy 与 API 测试通过。
2026-10-13 23:18:43 +08:00
que01 9ad2776515 feat: 遮蔽产物中的 Taro 指纹
H5 预览与小程序产物会带出 taro_tmpl、taro-*-core、taro.js、--taro-button-height、
project.config.json 的 projectname 等指纹,而 Taro 4.3 没有隐藏这些名称的配置。
改为在 build:h5、build:weapp、build:preview 之后按 apps/taro/config/mask.config.json
做构建后处理:

- 同一张替换表同时作用于文件名与文本内容,重命名后引用保持同步,长度 ≥ 40 的 base64/哈希片段原样保留;
- 遮蔽后仍命中 forbidden 词表时构建失败,并把 project.config.json 的 projectname/description 中性化;
- dev:h5、dev:preview 保持原始命名,便于本地调试;改架构名只改 mask.config.json;
- 产物契约测试先用 unmask() 还原再断言,浏览器测试选择器写成 :is(<源码名>, <遮蔽名>)。

取舍与迁移见 docs/adr/0025-build-output-stack-masking.md。
2026-10-13 23:03:32 +08:00
que01 53713e5935 fix: 上传缓存目录不再污染仓库
miniprogram-ci 的 SummerCompiler 用 path.join("", md5(projectPath + "|summer"))
建编译缓存,得到的是相对路径,会创建在进程工作目录下。上传子进程此前继承
API 进程的工作目录,于是每次上传都在 apps/api 下留下一个 32 位十六进制空目录。

把上传子进程的工作目录固定到 MINIAPP_UPLOAD_WORKSPACE(默认系统临时目录),
缓存随之落在临时目录,仓库保持干净;projectPath 一直是绝对路径,行为不受影响。

用真实 ensureCacheDir 验证目录落在临时工作目录,并断言仓库内不再新增缓存目录。
2026-10-13 22:11:33 +08:00
que01 ac3f433ee6 feat: 重做小程序发布任务卡片并支持配置请求地址
- 发布任务卡片拆为 MiniAppReleaseCard,状态用中文映射并附下一步说明,构建日志收进折叠面板,构建中自动滚动到底部
- 小程序配置增加“小程序请求地址”字段,展示当前生效域名,未配置时直接提示原因与修复位置
- 顶部上传按钮在无任务时自动创建发布任务,不再报“还没有可发布的内容版本”
- 构建轮询在任务被判定为中断后停止,避免页面空转请求
2026-10-13 21:59:00 +08:00
que01 44fe7a0142 fix: 打通小程序代码上传链路
小程序上传此前连续失败,根因分散在状态机、产物路径、模块导入、私钥解析和进程隔离上,逐项修复:

- 构建进度改用 updateBuild 只写 buildStatus/buildLogs,不再用 updateStatus 记录进度,避免状态机拒绝自我迁移而返回 409
- 产物目录锚定仓库根目录,不再随 API 进程工作目录变成 apps/api/apps/taro/dist
- miniprogram-ci 为 CommonJS 包,动态导入后从 default 归一化取 Project/upload,替换原有的类型断言
- 上传私钥统一还原成合法 PEM;输入框曾把换行吞成单行,导致 OpenSSL 解码失败,现保存时校验、上传时自动修复存量数据
- 上传改在独立子进程执行,miniprogram-ci 崩溃或超时不再终止 API 进程,失败返回 502 并保留微信原始错误
- 构建超过 MINIAPP_BUILD_STALE_MS 无进度即视为中断,允许重新上传,避免任务永久卡在 building
- 构建前校验请求地址与 AppID,请求地址支持在品牌配置中维护,环境变量仅作回落,避免再打出指向 localhost 的包
- 小程序 /media/ 按请求地址的 origin 解析,不再依赖网关剥离 /api 前缀

新增对应单测与集成断言,并更新部署说明。
2026-10-13 21:58:48 +08:00
que01 f52577ff9e fix: 兼容线上小程序构建状态迁移 2026-10-13 20:34:40 +08:00
que01 8e90b8ca09 fix: 分离小程序构建状态与发布状态 2026-10-13 20:31:49 +08:00
que01 998e32e49c feat: 展示小程序构建过程和日志 2026-10-13 20:20:13 +08:00
que01 8b4d27b0ee fix: 按模板包定位小程序构建产物 2026-10-13 20:06:52 +08:00
que01 26f1157083 fix: 恢复小程序上传配置并固定产物目录 2026-10-13 19:56:45 +08:00
que01 ad949ab370 feat: 简化小程序上传入口 2026-10-13 17:58:57 +08:00
que01 d5a84b51a7 fix: 恢复 API 编译运行并支持 watch 2026-10-13 17:53:57 +08:00
que01 760f41a584 chore: API 开发模式支持热重载 2026-10-13 17:51:45 +08:00
que01 20f880a761 fix: 修正发布中心标签页内容归属 2026-10-13 17:47:38 +08:00
que01 ab1531d9b0 feat: 拆分发布中心内容和小程序标签页 2026-10-13 17:41:52 +08:00
que01 3d0252d187 feat: 支持小程序上传配置加密存储 2026-10-13 17:28:40 +08:00
que01 526a9db789 feat: 实现小程序代码发布任务闭环 2026-10-13 17:13:24 +08:00
que01 9b35b8e7a7 docs: 确认小程序发布中心架构 2026-10-13 17:12:47 +08:00
que01 14b6541bee fix: 避免编辑覆盖层触发画布选中 2026-10-13 16:28:15 +08:00
que01 00edcedbcf fix: 优化预览区域选择提示布局 2026-10-13 16:04:19 +08:00
que01 dcf1d76944 fix: 修复本地图片上传与发布进程切换 2026-10-13 16:00:42 +08:00
que01 7f67f4d685 chore: 增加部署状态与备份保留 2026-10-13 15:14:27 +08:00
que01 d2ca528543 fix: 完善部署回滚健康检查
CI / Static checks (push) Has been cancelled
CI / Production build (push) Has been cancelled
CI / API integration (push) Has been cancelled
CI / Browser regression (push) Has been cancelled
2026-10-13 15:05:02 +08:00
que01 47a24e0d53 chore: 固化一键生产部署流程
CI / Static checks (push) Has been cancelled
CI / Production build (push) Has been cancelled
CI / API integration (push) Has been cancelled
CI / Browser regression (push) Has been cancelled
2026-10-13 14:56:16 +08:00
que01 c78deafee3 fix: 清理模板编译失败产物并登记审查 2026-10-13 11:37:43 +08:00
que01 3330b536dc fix: 统一小程序按钮契约并补齐模板图标 2026-10-13 11:12:53 +08:00
que01 07629a4596 fix: 补全小程序媒体地址并支持构建注入 AppID 2026-10-13 09:51:38 +08:00
que01 5c6ad02f46 chore: 完善生产发布与部署校验 2026-10-13 09:19:57 +08:00
que01 048c42207c chore: 添加生产级 Docker 部署配置与 ARM64 支持
CI / Static checks (push) Has been cancelled
CI / Production build (push) Has been cancelled
CI / API integration (push) Has been cancelled
CI / Browser regression (push) Has been cancelled
2026-10-12 18:19:29 +08:00
que01 67735afd45 chore: 忽略本地调试产物 2026-10-12 15:33:03 +08:00
que01 0574a85632 fix: 修复预览 loading 与媒体代理 2026-10-12 15:31:25 +08:00
que01 18ddf125be fix: 修复品牌预览渲染循环与区域点选 2026-10-12 12:00:46 +08:00
que01 bb0709b8cc feat: 能力插件元数据与运行时消费闭环 2026-10-12 11:20:43 +08:00
que01 076c6124c8 refactor: Taro 模板发现与校验收敛为目录驱动 2026-10-12 10:06:20 +08:00
que01 89fdfd7d83 refactor: 模板注册与默认模板收敛到目录驱动 2026-10-12 10:00:46 +08:00
que01 f87b26b201 merge: 合并代码结构标准重构 2026-10-12 05:11:26 +08:00
que01 466dc66907 refactor: 拆分业务、信任内容与公共工作台模块 2026-10-12 05:11:26 +08:00
que01 357f271639 refactor: 拆分 API Client 资源模块 2026-10-12 03:37:05 +08:00
que01 f3adf7bc15 style: 格式化工作台控制器 2026-10-12 03:36:57 +08:00
que01 4512d2601d refactor: 拆分工作台业务服务边界 2026-10-12 03:29:30 +08:00
que01 d0902d6568 refactor: 拆分模板配置契约与注册逻辑 2026-10-12 03:26:43 +08:00
que01 7e1dd543fb refactor: 拆分工作台查询与模板变更逻辑 2026-10-12 03:17:28 +08:00
que01 3003e7801d refactor: 建立代码标准并拆分品牌编辑状态 2026-10-12 03:08:24 +08:00
que01 567921e726 feat: 还原示例图片并优化媒体选择交互 2026-10-12 02:48:14 +08:00
que01 03f947e9b8 feat: 迁移示例媒体到本地存储 2026-10-12 02:09:08 +08:00
que01 6ac2d9421b feat: 支持本地媒体存储与上传回退 2026-10-12 01:39:56 +08:00
que01 aa42e7b866 fix: 修复 Admin 浏览器运行缺少 process 2026-10-12 01:05:18 +08:00
que01 e09b56e0f3 feat: 完善媒体存储状态与上传失败提示 2026-10-12 01:00:02 +08:00
que01 84956b8fe2 feat: 接入对象存储图片直传 2026-10-12 00:55:30 +08:00
que01 f57c0ca0ea ci: 增加发布产物打包脚本 2026-10-12 00:46:07 +08:00
que01 9c15a822e9 ci: 增加部署后发布验收脚本 2026-10-12 00:44:21 +08:00
que01 85f37d2eae ci: 建立完整发布门禁流水线 2026-10-12 00:41:14 +08:00
que01 222055595c docs: 明确模板预览产物结构 2026-10-12 00:26:18 +08:00
que01 b1d5c2b4b0 docs: 补充生产发布基线 2026-10-12 00:23:36 +08:00
que01 787a50369f fix: 收敛分类键运行时契约 2026-10-12 00:03:03 +08:00
que01 422162e580 chore: 移除林然演示品牌数据 2026-10-11 23:26:54 +08:00
que01 26bcb2b66e feat: 完善模板字段编辑与分类治理 2026-10-11 23:07:53 +08:00
que01 91322fa9a0 feat: 统一业务内容双入口编辑预览 2026-10-11 12:55:13 +08:00
que01 bfbcee45bb feat: 业务视图切换联动字段分组 2026-10-10 17:37:12 +08:00
que01 46b1690f6c feat: 分组业务编辑字段与预览目标 2026-10-10 17:34:22 +08:00
que01 0e0ca201a7 feat: 业务编辑支持列表与详情实时预览 2026-10-10 17:31:47 +08:00
que01 569156c977 feat: 业务编辑弹窗接入预览画布 2026-10-10 17:21:00 +08:00
que01 20e7e8bb81 feat: 业务列表支持跳转页面编辑 2026-10-10 17:12:43 +08:00
que01 20eb160abf feat: 打通业务与页面编辑入口 2026-10-10 17:08:19 +08:00
que01 d0ef25cfb3 refactor: 抽取业务与信任内容公共编辑器 2026-10-10 17:03:41 +08:00
que01 d2ce2d2a84 feat: 接入模板诊断人工审阅登记 2026-10-10 16:43:12 +08:00
que01 f57e1b1336 fix: 修复编辑器与 API Client lint 问题 2026-10-10 16:33:31 +08:00
que01 22a82dbfba fix: 完善模板可视化编辑闭环与通用验收 2026-10-10 16:20:08 +08:00
que01 fa6b492bce feat: 完善编辑工作台保存与离开体验 2026-10-10 11:22:49 +08:00
que01 860d9266fe feat: 构建品牌视图与三栏页面编辑工作台 2026-10-10 10:38:47 +08:00
que01 a2932b1134 refactor: 整理品牌配置与小程序编辑工作区 2026-10-10 10:20:14 +08:00
que01 849ae5df05 feat: 完善模板区域预览与详情页编辑边界 2026-10-10 09:51:12 +08:00
que01 df2b1f6031 fix: 补齐餐饮首页可编辑区域 2026-10-09 17:53:47 +08:00
que01 66dbba5748 feat: 完成模板区域与咨询字段编辑闭环 2026-10-09 17:33:39 +08:00
que01 c5db30f817 feat: 补齐模板预览区域与编辑绑定 2026-10-09 16:14:06 +08:00
que01 541304a763 fix: 修复预览成功页与记录页运行时报错 2026-10-09 15:24:15 +08:00
que01 fd2e970d8b fix: 修复组件预览底部按钮溢出与咨询表单缺失 2026-10-09 15:12:40 +08:00
que01 5b85fe769f feat: 完善后台可视化模板编辑与区域绑定 2026-10-09 14:26:05 +08:00
que01 0b14b5a814 feat: 建立组件化模板预览基线并规划可视化编辑 2026-10-09 12:32:24 +08:00
que01 c5af790554 feat: 增加可视化模板页面编辑器 2026-10-08 18:00:36 +08:00
605 changed files with 77570 additions and 11010 deletions

No files matched your search

@@ -0,0 +1,30 @@
# Admin 编辑工作区重构
## 目标
把 Admin 的品牌配置与小程序页面编辑整理成一个层级清晰、可持续扩展的工作区。用户能够明确区分品牌基础资料、模板内容、业务记录和页面预览;页面预览、区域选择和字段编辑保持统一行为。
## 交付边界
- 品牌资料页面减少 Card 堆叠,形成连续的配置分组。
- 小程序页面配置成为主要编辑工作区,使用页面导航、预览画布和编辑面板的稳定布局。
- 详情页只提供业务记录选择和动态预览,不出现品牌级详情编辑表单。
- 预览选区、高亮、编辑状态、空状态和错误状态保持一致。
- 不改变后端数据模型和小程序业务语义;模板仍通过 manifest 声明页面、区域和字段。
## 设计原则
- 基础品牌事实只提供一个编辑入口。
- 模板专属字段由模板 manifest 驱动,不在共享页面中写行业逻辑。
- 预览是编辑上下文的一部分,不单独启动每个模板服务。
- 详情页数据来自选中的业务记录,视觉文案只能作为模板配置存在。
- 页面区块使用平面分组和分隔线,只有真正需要独立操作的区域使用 Card。
## 验收标准
- 1920、1280、1024、768 和 390 宽度下布局无横向溢出。
- 品牌资料、页面配置和发布状态的层级可以在首屏理解。
- 首页、业务、服务、详情、咨询、成功和记录页面均可切换并保持稳定高度。
- 点击模板区域后,选区高亮和右侧编辑面板始终同步。
- 详情页只能选择业务记录并预览,不能出现品牌级详情字段编辑。
- 通过 Admin/Taro typecheck、模板契约测试、生产构建和关键浏览器交互测试。
@@ -0,0 +1,40 @@
# Progress
## 保存体验收尾
- 品牌资料、页面字段、记录和咨询字段暴露未保存状态;保存成功清除对应状态,失败保留输入。
- 切换页面/记录提供取消或放弃确认,刷新关闭窗口提供提醒,工作区内链接离开提供确认。
- 保存操作区采用统一的面板底部样式;业务记录与品牌配置继续分别保存到原有接口。
- 浏览器测试补充未保存取消切换与失败重试场景;测试采用独立接口 fixture,不冒充当前数据库的端到端验收。
- 本轮没有重构品牌切换器或新增跨实体批量保存 API,这些不作为已验证能力。
## 工作台重构补充验收
- 上一轮将布局整理判为全部完成不准确,补充真正的工作台任务:视图分离、三栏布局和层级区域导航。
- 默认显示页面编辑,品牌基础表单在“品牌资料”视图访问;两套组件保持挂载,切换不丢弃草稿。
- 区域导航移至左栏,预览居中,属性编辑位于右栏;子区域缩进,选区与导航选中状态同步。
- 顶部区分草稿工作区与检查发布入口,保存仍由各内容表单负责,避免错误承诺跨实体统一保存。
- 已通过 2 项浏览器回归和五种宽度检查,并查看 1920 宽度实际截图。
## 2026-10-10
- 建立 Admin 编辑工作区重构 Epic。
- 当前已知问题:品牌资料上方存在多个连续 Card;小程序页面配置仍是普通 Card;预览区和编辑面板层级不够明确;详情页需要保持动态只读预览;选区高亮需要继续验证真实鼠标路径。
- 当前基线能力:模板 manifest、Taro renderer、RuntimeWorkspace 和 Admin 字段绑定已经形成契约;本 Epic 主要调整 Admin 信息架构与视觉层。
- 第 1 项已完成:确认 `BrandPage` 的两列 Card 结构、页面配置固定最小高度、模板说明右栏和编辑器内部重复导航。
- 第 2 项开始:先整理品牌资料页面层级,减少 Card 作为页面区块容器的使用。
- 第 2 项阶段性完成:`BrandPage` 已将品牌身份、联系合作、模板视觉改为连续分组,模板说明改为右侧辅助 `Alert`,并增加移动端断点。
- 验证:Admin typecheck 通过,`admin-editor.spec.ts` 2 项通过。
- 第 2 项完成,第 3 项开始:`PresentationEditor` 已移除外层 Card 和固定最小高度,改为独立工作区标题区;下一步处理工作区内部布局和视觉状态。
- 工作区完成:品牌配置使用连续分组;模板辅助信息移入基础资料尾部;编辑器使用完整宽度两栏布局,窄屏上下排列。
- 未选中时显示引导,详情页目标列表为空且不显示点选工具。
- 新增 1920/1280/1024/768/390 宽度无溢出断言和截图,已人工查看 1280 与 390 截图。
- 验证通过:Admin/Taro typecheck、Admin lint、全仓 format:check、19 项模板契约测试、Admin build、2 项浏览器测试。
- lint 暴露已有 InquiryPreviewEditor 类型问题,已通过 Form 泛型和普通对象传入修复。
- 保留已知构建 api chunk 超过 500 kB 提示,后续由 Admin 前端打包优化任务负责;记录在 ADR 0021。
- 本轮不涉及新增 API 或数据迁移。
- 最终收尾完成:新增全局未保存离开提醒、切换确认、保存状态和失败保留输入;属性面板保存按钮固定在底部。
- 验证通过:Admin/Taro typecheck、Admin lint、format:check、19 项模板契约、Admin build、浏览器 2 项(含未保存取消切换与失败重试)。
- 构建仍有 api chunk 超过 500 kB 的提示,属于后续打包优化项,不影响构建结果。
@@ -0,0 +1,6 @@
id,title,status,task_type,depends_on,acceptance_criteria,validation_command,task_dir,notes
1,建立现状基线与页面覆盖清单,DONE,single-full,,记录当前布局层级、Card 使用、响应式问题和关键交互,测试基线截图与 DOM 检查,.codex-tasks/admin-editor-workspace/tasks/01-baseline/,已完成代码结构基线与验证记录
2,重构品牌配置的信息架构,DONE,single-full,1,品牌资料按身份联系模板视觉分组且减少卡片嵌套,Admin typecheck; browser brand page test,.codex-tasks/admin-editor-workspace/tasks/02-information-architecture/,已完成分组与模板说明层级调整
3,重构小程序页面编辑工作区,DONE,single-full,1;2,页面导航预览画布编辑面板形成稳定三栏或响应式两栏布局,Admin build; browser editor test,.codex-tasks/admin-editor-workspace/tasks/03-workspace-ui/,完整宽度两栏工作区,窄屏堆叠;详情页只读;未选中显示引导
4,统一编辑器视觉系统与状态样式,DONE,single-full,3,间距层级按钮选区空状态错误状态统一且无 Card 堆叠,Prettier; Admin build; screenshot review,.codex-tasks/admin-editor-workspace/tasks/04-visual-system/,统一导航工具条、画布边界、区域按钮和面板间距;已检查 1280 与 390 截图
5,全页面回归与交付验收,DONE,single-full,2;3;4,关键页面交互和响应式检查通过并记录残余风险,validate:templates; typecheck; build; browser tests,.codex-tasks/admin-editor-workspace/tasks/05-regression/,5 种宽度无溢出;浏览器 2 项、契约 19 项、格式、lint、类型和构建通过
1 id title status task_type depends_on acceptance_criteria validation_command task_dir notes
2 1 建立现状基线与页面覆盖清单 DONE single-full 记录当前布局层级、Card 使用、响应式问题和关键交互 测试基线截图与 DOM 检查 .codex-tasks/admin-editor-workspace/tasks/01-baseline/ 已完成代码结构基线与验证记录
3 2 重构品牌配置的信息架构 DONE single-full 1 品牌资料按身份联系模板视觉分组且减少卡片嵌套 Admin typecheck; browser brand page test .codex-tasks/admin-editor-workspace/tasks/02-information-architecture/ 已完成分组与模板说明层级调整
4 3 重构小程序页面编辑工作区 DONE single-full 1;2 页面导航预览画布编辑面板形成稳定三栏或响应式两栏布局 Admin build; browser editor test .codex-tasks/admin-editor-workspace/tasks/03-workspace-ui/ 完整宽度两栏工作区,窄屏堆叠;详情页只读;未选中显示引导
5 4 统一编辑器视觉系统与状态样式 DONE single-full 3 间距层级按钮选区空状态错误状态统一且无 Card 堆叠 Prettier; Admin build; screenshot review .codex-tasks/admin-editor-workspace/tasks/04-visual-system/ 统一导航工具条、画布边界、区域按钮和面板间距;已检查 1280 与 390 截图
6 5 全页面回归与交付验收 DONE single-full 2;3;4 关键页面交互和响应式检查通过并记录残余风险 validate:templates; typecheck; build; browser tests .codex-tasks/admin-editor-workspace/tasks/05-regression/ 5 种宽度无溢出;浏览器 2 项、契约 19 项、格式、lint、类型和构建通过
@@ -0,0 +1,32 @@
# 当前基线
## 页面结构
- `BrandPage` 使用两列布局:左侧 `xl=16`,右侧 `xl=8`。
- 左侧依次渲染“我是谁”“如何联系与合作”“模板与品牌视觉”三个 `Card`。
- 左侧表单之后渲染“小程序页面配置” `Card`。
- 右侧单独渲染“模板说明” `Card`。
- 页面配置内部还有页面导航、页面预览、详情业务选择器、预览目标按钮和右侧编辑表单。
## 已确认问题
- 配置 Card 与页面编辑 Card 在视觉上处于同一层级,用户难以判断基础资料和页面编辑的关系。
- “模板说明”占据右侧固定列,但对编辑流程帮助有限,造成首屏空间浪费。
- 页面配置使用 `minHeight: 760/620`,内容较少的页面会出现大面积空白。
- 页面配置内部的预览目标按钮与画布选区重复表达同一件事。
- 详情页已经改为动态预览提示,但页面整体仍沿用通用编辑器的表单布局。
- 品牌资料表单保存按钮位于所有配置分组之后,长页面中不够容易发现。
## 现有可复用能力
- 模板 manifest 声明页面、区域、字段和 preview target。
- `RuntimeWorkspace` 为组件预览提供品牌、业务记录、信任内容和咨询表单数据。
- `ComponentTemplatePreview` 支持点选、高亮、组合区域和浏览模式。
- `PresentationEditor` 已支持业务记录编辑、信任内容编辑和咨询字段编辑。
## 基线验证
- `pnpm --filter @personal-brand/admin typecheck`:通过。
- `pnpm --filter @personal-brand/taro typecheck`:通过。
- `pnpm validate:templates`:19 项模板契约测试通过。
- 已有 `admin-editor.spec.ts` 覆盖页面切换、预览选区、业务记录、信任内容、咨询表单和详情页动态预览。
@@ -0,0 +1,64 @@
# 本轮执行进度
## 当前恢复点
- 任务:现有两模板按通用规则诊断、修复、验收。
- 形态:single-full。
- 进度:7/7;任务真源为 TODO.csv。
- 当前:本轮审计修复和证据归档完成,详见 docs/template-audit-2026-10-10.md。
- 验证:真实数据库集成 41 项通过,覆盖 193 个声明绑定;真实 manifest 浏览器逐页/320 与 390 宽布局、全部实际存在目标的画布内部点选、方法和流程子字段修改重载共 2 项通过(42.3 秒)。
- 静态报告:两模板 blocker 均为 0,food review 55,linjing review 23;命令仍退出 1,保留原报告 completionStatus=unverified。
- 动态审查:raw/manual-review.json 为每条 review 保存来源、只读理由和证据;条件组合未穷举,不将源码审查冒充浏览器全分支验证。
- 数据:只在随机独立 schema 做 integration;没有生产 migration 或 seed 改写。
- 下一步:当前无剩余实现任务;保持未提交 diff,后续模板按相同规则验收。静态 completionStatus 不自动改为完整通过。
## 本轮新增故障与修复
1. 新 config 被旧完整品牌对象覆盖:仅发送改变的标准字段和新 config,剔除模板选择字段。
2. 保存后 Admin 预览读取旧发布快照:从当前品牌记录构建内存草稿,与公开投影共用服务;公开仍读取发布快照。
3. 旧 config.avatarUrl 覆盖共享头像:标准列优先,主动清空后旧别名不得复活。
4. templateFields 错页、templateData 未同步:按 page 分组并同步专属草稿。
5. 列表只检查 binding:补逐个 itemFields 检查及排序;空区域提供内容管理入口。
6. 详情正文与底部按钮共用目标:拆为两个公共编辑区,业务记录仍仅选择预览。
## 画布检查的失败记录
新增检查先后发现测试命中点不正确:圆角透明角落、父容器采样落在子区、装饰图片被遮罩覆盖。原始失败保留 raw/browser-*-failure.log;最终也发现林境 fixture 缺少所有介绍标题,使父区域没有显示文字,补真实结构的标题内容后验收通过。重新审查测试输入后,改为点击目标内有文字的叶子内容,并先确认浏览器真实 elementFromPoint 命中的最近目标。没有强制点击、删业务断言或改变模板视觉。
## 前轮历史(已被本轮验证补充)
# 本轮审计结果
本轮按 skill 完成诊断、修复、回归与剩余项归档;模板整体验收仍为 unverified。
## 静态结果
- acheng-campus-food:blocker 11 → 2;review 120
- linjing-editorial:blocker 26 → 2;review 65
## 已验证
- 林境真实 manifest:主理人完整字段、最近选区、统计 2×2、数值编辑保存重载、共享简介保存重载、侧栏信任记录定位、主理人页不出现首页统计目标。
- 餐饮现有浏览器回归通过,新增共享字段未逐一完成端到端验证。
- 浏览器 2 项通过;模板契约 19 项、诊断器 15 项通过;Admin 单元测试、Admin/Taro 类型、Admin lint 与生产构建、全仓格式及 diff 检查通过。
- 独立随机 schema 的 API 集成 40 项通过;不等于所有新模板字段发布流程逐项已验证。
## 未完成与限制
- 两模板详情页公共按钮文案仍由品牌配置读取,与只读详情预览边界需进一步明确,4 条静态 blocker 保留。
- 动态循环、条件分支等 review 仍需逐项核对,不能用静态报告证明完整。
- 林境截图验证 2×2,使用 fixture 主图且头像未加载,不能作为真实原型视觉一致性证明;原型全量对照未完成。
- 未对每个新增共享字段执行真实数据库发布后公开读取;现有集成通过不能替代该覆盖。
- Admin 构建仍有已有大于 500 kB chunk 提示。
## 经验沉淀
新增多入口绑定同步及未挂载字段保留规则,补入 skill 和回归。未提交 commit,未迁移生产数据。
## 最终门槛
- browser-current.log:2/2 通过,42.3 秒;实际画布目标检查没有使用 force 或 dispatchEvent。
- integration-final.log:41/41 通过,193 个真实绑定保存/草稿/发布验证。
- API Client 3/3、模板契约 19/19、诊断器 19/19;API/Admin/Taro 类型检查通过。
- API/Admin lint、Admin 构建、两模板 H5 与 weapp 构建通过;格式和 diff 检查通过。
- 完整范围、78 条动态映射 review 的源码审阅和视觉限制保留在最终文档及 raw/manual-review.json;没有将静态退出 1 隐藏为通过。
@@ -0,0 +1,3 @@
# 按 template-completion-audit 执行现有模板审计
范围:自动发现两个模板,修复共享字段入口、选区、信任页作用域与实际绑定,运行真实 manifest 浏览器及隔离数据库回归,记录未完成证据。没有生产数据迁移或自动提交。
@@ -0,0 +1,8 @@
id,task,status,acceptance_criteria,validation_command,completed_at,retry_count,notes
1,采集真实基线,DONE,before 报告已存档,node scripts/template-doctor.mjs,2026-10-10,0,退出 1 保留实际问题
2,修复公共编辑和字段绑定,DONE,真实 manifest 修改保存重载测试通过,playwright admin-editor.spec.ts,2026-10-10,1,修复共享字段未挂载覆盖
3,执行审计验证并归档边界,DONE,保留未验证和失败项,pnpm format:check,2026-10-10,0,详情按钮与原型全量验收未完成
4,补齐详情公共文案和真实卡片字段,DONE,所有展示字段有对应入口,pnpm validate:templates,2026-10-10,0,详情正文与底部按钮独立目标;真实卡片字段补齐;模板契约 19 项通过
5,验证真实声明的浏览器编辑闭环,DONE,两个模板真实声明保存重载测试通过,playwright admin-editor.spec.ts,2026-10-10,0,2 项真实 manifest 浏览器通过;含逐页画布内部点击、字段面板、列表子项修改重载和多宽检查
6,验证数据库保存发布隔离,DONE,新增字段真实持久化发布回归通过,pnpm --filter @personal-brand/api test:integration,2026-10-10,0,41 项集成通过;193 个真实绑定隔离数据库保存草稿发布验证
7,归档动态映射和视觉验收,DONE,逐项证据与门槛验证完成,pnpm template:doctor,2026-10-10,4,78 条动态审查归档;最终画布检查通过;原型结构与视觉边界详见 docs/template-audit-2026-10-10.md
1 id task status acceptance_criteria validation_command completed_at retry_count notes
2 1 采集真实基线 DONE before 报告已存档 node scripts/template-doctor.mjs 2026-10-10 0 退出 1 保留实际问题
3 2 修复公共编辑和字段绑定 DONE 真实 manifest 修改保存重载测试通过 playwright admin-editor.spec.ts 2026-10-10 1 修复共享字段未挂载覆盖
4 3 执行审计验证并归档边界 DONE 保留未验证和失败项 pnpm format:check 2026-10-10 0 详情按钮与原型全量验收未完成
5 4 补齐详情公共文案和真实卡片字段 DONE 所有展示字段有对应入口 pnpm validate:templates 2026-10-10 0 详情正文与底部按钮独立目标;真实卡片字段补齐;模板契约 19 项通过
6 5 验证真实声明的浏览器编辑闭环 DONE 两个模板真实声明保存重载测试通过 playwright admin-editor.spec.ts 2026-10-10 0 2 项真实 manifest 浏览器通过;含逐页画布内部点击、字段面板、列表子项修改重载和多宽检查
7 6 验证数据库保存发布隔离 DONE 新增字段真实持久化发布回归通过 pnpm --filter @personal-brand/api test:integration 2026-10-10 0 41 项集成通过;193 个真实绑定隔离数据库保存草稿发布验证
8 7 归档动态映射和视觉验收 DONE 逐项证据与门槛验证完成 pnpm template:doctor 2026-10-10 4 78 条动态审查归档;最终画布检查通过;原型结构与视觉边界详见 docs/template-audit-2026-10-10.md
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,260 @@
{
"schemaVersion": 1,
"scope": "模板完成证据登记,保留命令、日志与产物哈希",
"generatedAt": "2026-10-23T09:54:31.191Z",
"templates": {
"acheng-campus-food": {
"real-manifest-interaction": {
"status": "passed",
"commands": [
"pnpm --filter @personal-brand/api test:integration",
"ADMIN_URL=http://localhost:3000 pnpm --filter @personal-brand/taro exec playwright test test/browser/admin-editor.spec.ts"
],
"artifacts": [
{
"path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-20-final/api-integration.log",
"sha256": "1efcc2e20c32dc9b42f960a6967a6e94a32aa9e49ca855c17d61b2bc7f6ab891"
},
{
"path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-20/admin-editor.log",
"sha256": "281c1bba68b5f6e30438d925ea58d8454bd98cf538fab8217710c7dc4402d103"
}
],
"exitCode": 0
},
"save-reload-publish-isolation": {
"status": "passed",
"commands": [
"pnpm --filter @personal-brand/api test:integration"
],
"artifacts": [
{
"path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-20-final/api-integration.log",
"sha256": "1efcc2e20c32dc9b42f960a6967a6e94a32aa9e49ca855c17d61b2bc7f6ab891"
},
{
"path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-20-final/api-unit.log",
"sha256": "8a7a4bbd46be04b7c89318b702886d75acdb3707d9035c789e1d0550fd052b6e"
}
],
"exitCode": 0
},
"visual-reference": {
"status": "passed",
"commands": [
"TEMPLATE_PREVIEW_VISUAL_EVIDENCE=/home/que01/Project/persionalBrand/.codex-tasks/template-audit-execution/raw/visual-matrix-final ADMIN_URL=http://localhost:3000 pnpm --filter @personal-brand/taro exec playwright test test/browser/template-preview-media.spec.ts"
],
"artifacts": [
{
"path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-20/template-preview-media.log",
"sha256": "3eb8132e3fae6c95e2820d2979422ab63ab93e52426de8bcd528fd16b36eba3c"
},
{
"path": ".codex-tasks/template-audit-execution/raw/visual-matrix-final/01-acheng-campus-food-food-320.png",
"sha256": "3aa442379e6847eeda18b97df78fadb077f6b678ee09f99d692b8fd357d37422"
},
{
"path": ".codex-tasks/template-audit-execution/raw/visual-matrix-final/01-acheng-campus-food-food-375.png",
"sha256": "a0cc26679391dc851056551dcd5b31f50603bfd0dc44a59bc5182ea377a2747f"
},
{
"path": ".codex-tasks/template-audit-execution/raw/visual-matrix-final/01-acheng-campus-food-food-390.png",
"sha256": "f5d517380140ed62bb306a79fdbf818e1846c7ff58ebf229c2c8ed1142221537"
}
],
"exitCode": 0
},
"empty-error-branches": {
"status": "passed",
"commands": [
"TEMPLATE_PREVIEW_VISUAL_EVIDENCE=/home/que01/Project/persionalBrand/.codex-tasks/template-audit-execution/raw/visual-matrix-final ADMIN_URL=http://localhost:3000 pnpm --filter @personal-brand/taro exec playwright test test/browser/template-preview-media.spec.ts",
"ADMIN_URL=http://localhost:3000 pnpm --filter @personal-brand/taro exec playwright test test/browser/admin-editor.spec.ts"
],
"artifacts": [
{
"path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-20/template-preview-media.log",
"sha256": "3eb8132e3fae6c95e2820d2979422ab63ab93e52426de8bcd528fd16b36eba3c"
},
{
"path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-20/admin-editor.log",
"sha256": "281c1bba68b5f6e30438d925ea58d8454bd98cf538fab8217710c7dc4402d103"
},
{
"path": ".codex-tasks/template-audit-execution/raw/visual-matrix-final/empty-01-acheng-campus-food-food.png",
"sha256": "2a8279db468ab65426f1cf5e13ff8dcffa6ef625bf9f3dd563165b8905a79043"
}
],
"exitCode": 0
}
},
"atelier-solopreneur": {
"real-manifest-interaction": {
"status": "passed",
"commands": [
"pnpm --filter @personal-brand/api test:integration",
"ADMIN_URL=http://localhost:3000 pnpm --filter @personal-brand/taro exec playwright test test/browser/admin-editor.spec.ts"
],
"artifacts": [
{
"path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-20-final/api-integration.log",
"sha256": "1efcc2e20c32dc9b42f960a6967a6e94a32aa9e49ca855c17d61b2bc7f6ab891"
},
{
"path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-20/admin-editor.log",
"sha256": "281c1bba68b5f6e30438d925ea58d8454bd98cf538fab8217710c7dc4402d103"
}
],
"exitCode": 0
},
"save-reload-publish-isolation": {
"status": "passed",
"commands": [
"pnpm --filter @personal-brand/api test:integration"
],
"artifacts": [
{
"path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-20-final/api-integration.log",
"sha256": "1efcc2e20c32dc9b42f960a6967a6e94a32aa9e49ca855c17d61b2bc7f6ab891"
},
{
"path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-20-final/api-unit.log",
"sha256": "8a7a4bbd46be04b7c89318b702886d75acdb3707d9035c789e1d0550fd052b6e"
}
],
"exitCode": 0
},
"visual-reference": {
"status": "passed",
"commands": [
"TEMPLATE_PREVIEW_VISUAL_EVIDENCE=/home/que01/Project/persionalBrand/.codex-tasks/template-audit-execution/raw/visual-matrix-final ADMIN_URL=http://localhost:3000 pnpm --filter @personal-brand/taro exec playwright test test/browser/template-preview-media.spec.ts"
],
"artifacts": [
{
"path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-20/template-preview-media.log",
"sha256": "3eb8132e3fae6c95e2820d2979422ab63ab93e52426de8bcd528fd16b36eba3c"
},
{
"path": ".codex-tasks/template-audit-execution/raw/visual-matrix-final/02-atelier-solopreneur-personal-320.png",
"sha256": "e55af9899393c7f9cfba9bb2b5c6ad6c447f90cf28dddd94da8feb6702fc8477"
},
{
"path": ".codex-tasks/template-audit-execution/raw/visual-matrix-final/02-atelier-solopreneur-personal-375.png",
"sha256": "70d251ab829ebfc85dba7fd65ac423272af4af54b39f76d1bea9ebbe0f89bc2d"
},
{
"path": ".codex-tasks/template-audit-execution/raw/visual-matrix-final/02-atelier-solopreneur-personal-390.png",
"sha256": "a430e7c72f794d62f9f0248c52307b6f644ea5b6099ba6c8b929f365504c3b07"
}
],
"exitCode": 0
},
"empty-error-branches": {
"status": "passed",
"commands": [
"TEMPLATE_PREVIEW_VISUAL_EVIDENCE=/home/que01/Project/persionalBrand/.codex-tasks/template-audit-execution/raw/visual-matrix-final ADMIN_URL=http://localhost:3000 pnpm --filter @personal-brand/taro exec playwright test test/browser/template-preview-media.spec.ts",
"ADMIN_URL=http://localhost:3000 pnpm --filter @personal-brand/taro exec playwright test test/browser/admin-editor.spec.ts"
],
"artifacts": [
{
"path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-20/template-preview-media.log",
"sha256": "3eb8132e3fae6c95e2820d2979422ab63ab93e52426de8bcd528fd16b36eba3c"
},
{
"path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-20/admin-editor.log",
"sha256": "281c1bba68b5f6e30438d925ea58d8454bd98cf538fab8217710c7dc4402d103"
},
{
"path": ".codex-tasks/template-audit-execution/raw/visual-matrix-final/empty-02-atelier-solopreneur-personal.png",
"sha256": "78982dd7aa7a8751e29969de9f68c6c3eab0bcdb2403f1a5442f10cc03b9a843"
}
],
"exitCode": 0
}
},
"linjing-editorial": {
"real-manifest-interaction": {
"status": "passed",
"commands": [
"pnpm --filter @personal-brand/api test:integration",
"ADMIN_URL=http://localhost:3000 pnpm --filter @personal-brand/taro exec playwright test test/browser/admin-editor.spec.ts"
],
"artifacts": [
{
"path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-20-final/api-integration.log",
"sha256": "1efcc2e20c32dc9b42f960a6967a6e94a32aa9e49ca855c17d61b2bc7f6ab891"
},
{
"path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-20/admin-editor.log",
"sha256": "281c1bba68b5f6e30438d925ea58d8454bd98cf538fab8217710c7dc4402d103"
}
],
"exitCode": 0
},
"save-reload-publish-isolation": {
"status": "passed",
"commands": [
"pnpm --filter @personal-brand/api test:integration"
],
"artifacts": [
{
"path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-20-final/api-integration.log",
"sha256": "1efcc2e20c32dc9b42f960a6967a6e94a32aa9e49ca855c17d61b2bc7f6ab891"
},
{
"path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-20-final/api-unit.log",
"sha256": "8a7a4bbd46be04b7c89318b702886d75acdb3707d9035c789e1d0550fd052b6e"
}
],
"exitCode": 0
},
"visual-reference": {
"status": "passed",
"commands": [
"TEMPLATE_PREVIEW_VISUAL_EVIDENCE=/home/que01/Project/persionalBrand/.codex-tasks/template-audit-execution/raw/visual-matrix-final ADMIN_URL=http://localhost:3000 pnpm --filter @personal-brand/taro exec playwright test test/browser/template-preview-media.spec.ts"
],
"artifacts": [
{
"path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-20/template-preview-media.log",
"sha256": "3eb8132e3fae6c95e2820d2979422ab63ab93e52426de8bcd528fd16b36eba3c"
},
{
"path": ".codex-tasks/template-audit-execution/raw/visual-matrix-final/03-linjing-editorial-doors-320.png",
"sha256": "d1569323ca5514b2348338a4c6f37bc3078c2e827e17943437efe8f437dd1188"
},
{
"path": ".codex-tasks/template-audit-execution/raw/visual-matrix-final/03-linjing-editorial-doors-375.png",
"sha256": "48960348d896631b6c0c788a5528a21e7eefe3339dfffdbff43330c062f7b983"
},
{
"path": ".codex-tasks/template-audit-execution/raw/visual-matrix-final/03-linjing-editorial-doors-390.png",
"sha256": "dd893c5958c3f4165ae988fef7be6882b27ccb3260112676ae296f2e6fef6be6"
}
],
"exitCode": 0
},
"empty-error-branches": {
"status": "passed",
"commands": [
"TEMPLATE_PREVIEW_VISUAL_EVIDENCE=/home/que01/Project/persionalBrand/.codex-tasks/template-audit-execution/raw/visual-matrix-final ADMIN_URL=http://localhost:3000 pnpm --filter @personal-brand/taro exec playwright test test/browser/template-preview-media.spec.ts",
"ADMIN_URL=http://localhost:3000 pnpm --filter @personal-brand/taro exec playwright test test/browser/admin-editor.spec.ts"
],
"artifacts": [
{
"path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-20/template-preview-media.log",
"sha256": "3eb8132e3fae6c95e2820d2979422ab63ab93e52426de8bcd528fd16b36eba3c"
},
{
"path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-20/admin-editor.log",
"sha256": "281c1bba68b5f6e30438d925ea58d8454bd98cf538fab8217710c7dc4402d103"
},
{
"path": ".codex-tasks/template-audit-execution/raw/visual-matrix-final/empty-03-linjing-editorial-doors.png",
"sha256": "d7b2b3197e426f1dd9b2ef99cd8682cb4c34531163b8ba5ebc90453438521970"
}
],
"exitCode": 0
}
}
},
"sourceTreeHash": "f07ae4270ab0424e283142ebdf72fd9d31a9222323ef677150b59a77f573a50b"
}
@@ -0,0 +1,11 @@
Running 2 tests using 1 worker
(node:633537) Warning: The 'NO_COLOR' env is ignored due to the 'FORCE_COLOR' env being set.
(Use `node --trace-warnings ...` to show where the warning was created)
(node:633537) Warning: The 'NO_COLOR' env is ignored due to the 'FORCE_COLOR' env being set.
(Use `node --trace-warnings ...` to show where the warning was created)
✓ 1 test/browser/admin-editor.spec.ts:235:5 › Admin 按通用预览目标筛选字段并同步品牌草稿 (26.4s)
✓ 2 test/browser/admin-editor.spec.ts:637:5 › 林境模板支持首页和主理人区域点选 (27.8s)
2 passed (55.7s)
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,18 @@
Running 1 test using 1 worker
(node:632552) Warning: The 'NO_COLOR' env is ignored due to the 'FORCE_COLOR' env being set.
(Use `node --trace-warnings ...` to show where the warning was created)
(node:632552) Warning: The 'NO_COLOR' env is ignored due to the 'FORCE_COLOR' env being set.
(Use `node --trace-warnings ...` to show where the warning was created)
(node:632689) Warning: The 'NO_COLOR' env is ignored due to the 'FORCE_COLOR' env being set.
(Use `node --trace-warnings ...` to show where the warning was created)
(node:632799) Warning: The 'NO_COLOR' env is ignored due to the 'FORCE_COLOR' env being set.
(Use `node --trace-warnings ...` to show where the warning was created)
(node:632867) Warning: The 'NO_COLOR' env is ignored due to the 'FORCE_COLOR' env being set.
(Use `node --trace-warnings ...` to show where the warning was created)
(node:632924) Warning: The 'NO_COLOR' env is ignored due to the 'FORCE_COLOR' env being set.
(Use `node --trace-warnings ...` to show where the warning was created)
✓ 1 test/browser/template-preview-media.spec.ts:155:5 › 导入包预览矩阵展示身份、资源和完整媒体槽位 (12.7s)
1 passed (14.2s)
@@ -0,0 +1,11 @@
Running 2 tests using 1 worker
(node:12847) Warning: The 'NO_COLOR' env is ignored due to the 'FORCE_COLOR' env being set.
(Use `node --trace-warnings ...` to show where the warning was created)
(node:12847) Warning: The 'NO_COLOR' env is ignored due to the 'FORCE_COLOR' env being set.
(Use `node --trace-warnings ...` to show where the warning was created)
✓ 1 test/browser/admin-editor.spec.ts:235:5 › Admin 按通用预览目标筛选字段并同步品牌草稿 (21.0s)
✓ 2 test/browser/admin-editor.spec.ts:654:5 › 林境模板支持首页和主理人区域点选 (22.2s)
2 passed (44.1s)
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,18 @@
Running 1 test using 1 worker
(node:12338) Warning: The 'NO_COLOR' env is ignored due to the 'FORCE_COLOR' env being set.
(Use `node --trace-warnings ...` to show where the warning was created)
(node:12338) Warning: The 'NO_COLOR' env is ignored due to the 'FORCE_COLOR' env being set.
(Use `node --trace-warnings ...` to show where the warning was created)
(node:12435) Warning: The 'NO_COLOR' env is ignored due to the 'FORCE_COLOR' env being set.
(Use `node --trace-warnings ...` to show where the warning was created)
(node:12543) Warning: The 'NO_COLOR' env is ignored due to the 'FORCE_COLOR' env being set.
(Use `node --trace-warnings ...` to show where the warning was created)
(node:12607) Warning: The 'NO_COLOR' env is ignored due to the 'FORCE_COLOR' env being set.
(Use `node --trace-warnings ...` to show where the warning was created)
(node:12662) Warning: The 'NO_COLOR' env is ignored due to the 'FORCE_COLOR' env being set.
(Use `node --trace-warnings ...` to show where the warning was created)
✓ 1 test/browser/template-preview-media.spec.ts:155:5 › 导入包预览矩阵展示身份、资源和完整媒体槽位 (9.1s)
1 passed (10.0s)
@@ -0,0 +1,440 @@
> @personal-brand/api@ test /home/que01/Project/persionalBrand/apps/api
> tsx --test test/**/*.test.ts
TAP version 13
# Subtest: 构建 worker 异常退出时返回明确非零结果
ok 1 - 构建 worker 异常退出时返回明确非零结果
---
duration_ms: 80.679734
type: 'test'
...
# Subtest: 构建 worker watchdog 超时会终止子进程并返回 timedOut
ok 2 - 构建 worker watchdog 超时会终止子进程并返回 timedOut
---
duration_ms: 36.587105
type: 'test'
...
# Subtest: 构建进度更新不触发发布状态机的顺序校验
ok 3 - 构建进度更新不触发发布状态机的顺序校验
---
duration_ms: 1.684099
type: 'test'
...
# Subtest: 构建进度更新按品牌隔离,任务不存在时抛出 404
ok 4 - 构建进度更新按品牌隔离,任务不存在时抛出 404
---
duration_ms: 0.989713
type: 'test'
...
# Subtest: 重新构建时可以清除上一次遗留的错误信息
ok 5 - 重新构建时可以清除上一次遗留的错误信息
---
duration_ms: 0.32377
type: 'test'
...
# Subtest: 发布状态机仍拒绝越级变更并允许合法上传流转
ok 6 - 发布状态机仍拒绝越级变更并允许合法上传流转
---
duration_ms: 0.879665
type: 'test'
...
# Subtest: 失败任务重试时可回到 built 并清除错误
ok 7 - 失败任务重试时可回到 built 并清除错误
---
duration_ms: 0.423466
type: 'test'
...
# Subtest: settings presentation never exposes plaintext credentials
ok 8 - settings presentation never exposes plaintext credentials
---
duration_ms: 2.507469
type: 'test'
...
# Subtest: update validates URL and private key before persistence
ok 9 - update validates URL and private key before persistence
---
duration_ms: 2.477873
type: 'test'
...
# Subtest: update encrypts a valid private key and preserves existing settings
ok 10 - update encrypts a valid private key and preserves existing settings
---
duration_ms: 2.609961
type: 'test'
...
# Subtest: upload blocks a currently building task before credentials are read
ok 11 - upload blocks a currently building task before credentials are read
---
duration_ms: 2.803565
type: 'test'
...
# Subtest: upload rejects invalid app configuration before building
ok 12 - upload rejects invalid app configuration before building
---
duration_ms: 0.739001
type: 'test'
...
# Subtest: failed build records logs and build failure state
ok 13 - failed build records logs and build failure state
---
duration_ms: 11.162244
type: 'test'
...
# Subtest: missing artifact records build failure without invoking upload
ok 14 - missing artifact records build failure without invoking upload
---
duration_ms: 1.657659
type: 'test'
...
# Subtest: upload rejects missing credentials before build
ok 15 - upload rejects missing credentials before build
---
duration_ms: 0.580422
type: 'test'
...
# Subtest: local mode reports configuration and returns a relative local upload URL
ok 16 - local mode reports configuration and returns a relative local upload URL
---
duration_ms: 19.254692
type: 'test'
...
# Subtest: upload service validates media type and traversal keys before persistence
ok 17 - upload service validates media type and traversal keys before persistence
---
duration_ms: 5.35153
type: 'test'
...
# Subtest: refactored admin controllers preserve their declared API routes
ok 18 - refactored admin controllers preserve their declared API routes
---
duration_ms: 2.171245
type: 'test'
...
# Subtest: root module composes bounded feature modules only
ok 19 - root module composes bounded feature modules only
---
duration_ms: 0.224672
type: 'test'
...
# Subtest: 创建普通套餐订单时保存价格快照和预计金额
ok 20 - 创建普通套餐订单时保存价格快照和预计金额
---
duration_ms: 3.15675
type: 'test'
...
# Subtest: 普通套餐不能在没有明细时创建
ok 21 - 普通套餐不能在没有明细时创建
---
duration_ms: 1.103406
type: 'test'
...
# Subtest: 客户只能取消自己的 received 订单
ok 22 - 客户只能取消自己的 received 订单
---
duration_ms: 0.528334
type: 'test'
...
# Subtest: 取消不存在或不属于当前客户的订单返回不存在
ok 23 - 取消不存在或不属于当前客户的订单返回不存在
---
duration_ms: 0.329831
type: 'test'
...
# Subtest: 订单状态只能按定义的状态机流转
ok 24 - 订单状态只能按定义的状态机流转
---
duration_ms: 0.789666
type: 'test'
...
# Subtest: 更新订单标签时拒绝其他品牌的标签
ok 25 - 更新订单标签时拒绝其他品牌的标签
---
duration_ms: 0.44106
type: 'test'
...
# Subtest: 开发 seed 引用的本地媒体都有随仓库分发的源文件
ok 26 - 开发 seed 引用的本地媒体都有随仓库分发的源文件
---
duration_ms: 1.65813
type: 'test'
...
# Subtest: 小程序产物根目录锚定仓库根目录,不随 API 进程工作目录变化
ok 27 - 小程序产物根目录锚定仓库根目录,不随 API 进程工作目录变化
---
duration_ms: 1.317639
type: 'test'
...
# Subtest: 按模板包 key 生成唯一的微信小程序产物目录
ok 28 - 按模板包 key 生成唯一的微信小程序产物目录
---
duration_ms: 0.275849
type: 'test'
...
# Subtest: 显式配置的产物根目录按仓库根目录解析相对路径
ok 29 - 显式配置的产物根目录按仓库根目录解析相对路径
---
duration_ms: 0.170942
type: 'test'
...
# Subtest: 发布产物路径隔离品牌、模板版本和 attempt
ok 30 - 发布产物路径隔离品牌、模板版本和 attempt
---
duration_ms: 0.400984
type: 'test'
...
# Subtest: 发布产物路径拒绝可能越界的品牌或模板字段
ok 31 - 发布产物路径拒绝可能越界的品牌或模板字段
---
duration_ms: 0.578859
type: 'test'
...
# Subtest: 后台配置的请求地址优先于环境变量,改域名不需要动服务端配置
ok 32 - 后台配置的请求地址优先于环境变量,改域名不需要动服务端配置
---
duration_ms: 1.515873
type: 'test'
...
# Subtest: 后台地址允许带路径前缀,保存前会去掉结尾斜杠
ok 33 - 后台地址允许带路径前缀,保存前会去掉结尾斜杠
---
duration_ms: 0.593416
type: 'test'
...
# Subtest: 优先使用 MINIAPP_API_BASE_URL,去掉结尾斜杠
ok 34 - 优先使用 MINIAPP_API_BASE_URL,去掉结尾斜杠
---
duration_ms: 0.192292
type: 'test'
...
# Subtest: 没有显式配置时由 PUBLIC_BASE_URL 加默认 /api 推导
ok 35 - 没有显式配置时由 PUBLIC_BASE_URL 加默认 /api 推导
---
duration_ms: 0.18611
type: 'test'
...
# Subtest: 非 https 的公网地址必须被拒绝,避免再次打出 localhost 包
ok 36 - 非 https 的公网地址必须被拒绝,避免再次打出 localhost 包
---
duration_ms: 0.437694
type: 'test'
...
# Subtest: 本地调试地址允许 http,方便开发环境构建
ok 37 - 本地调试地址允许 http,方便开发环境构建
---
duration_ms: 0.195187
type: 'test'
...
# Subtest: AppID 取品牌配置优先,回落 WEAPP_APP_ID,并拒绝占位值
ok 38 - AppID 取品牌配置优先,回落 WEAPP_APP_ID,并拒绝占位值
---
duration_ms: 0.381347
type: 'test'
...
# Subtest: 构建中的任务在超过阈值未更新时视为已中断
ok 39 - 构建中的任务在超过阈值未更新时视为已中断
---
duration_ms: 1.370659
type: 'test'
...
# Subtest: 非 building 状态永远不算中断,避免误伤正常流程
ok 40 - 非 building 状态永远不算中断,避免误伤正常流程
---
duration_ms: 0.278604
type: 'test'
...
# Subtest: 时间戳异常时按未中断处理,宁可挡住重试也不允许并发构建
ok 41 - 时间戳异常时按未中断处理,宁可挡住重试也不允许并发构建
---
duration_ms: 0.20209
type: 'test'
...
# Subtest: 阈值可通过环境变量覆盖,非法值回退到默认 30 分钟
ok 42 - 阈值可通过环境变量覆盖,非法值回退到默认 30 分钟
---
duration_ms: 0.285577
type: 'test'
...
# Subtest: 构建超时阈值支持环境变量并有独立默认值
ok 43 - 构建超时阈值支持环境变量并有独立默认值
---
duration_ms: 0.203984
type: 'test'
...
# Subtest: CommonJS 形态的 miniprogram-ci 从 default 上取 Project 与 upload
ok 44 - CommonJS 形态的 miniprogram-ci 从 default 上取 Project 与 upload
---
duration_ms: 1.180822
type: 'test'
...
# Subtest: 已是命名导出的模块可以直接使用
ok 45 - 已是命名导出的模块可以直接使用
---
duration_ms: 0.218942
type: 'test'
...
# Subtest: 缺少 Project 或 upload 时抛出明确错误,而不是 undefined is not a constructor
ok 46 - 缺少 Project 或 upload 时抛出明确错误,而不是 undefined is not a constructor
---
duration_ms: 0.67514
type: 'test'
...
# Subtest: 单行私钥(换行被输入框吞掉)可以还原为合法 PEM 并恢复签名能力
ok 47 - 单行私钥(换行被输入框吞掉)可以还原为合法 PEM 并恢复签名能力
---
duration_ms: 46.62352
type: 'test'
...
# Subtest: 字面量 \\n 转义的私钥同样可以还原
ok 48 - 字面量 \\n 转义的私钥同样可以还原
---
duration_ms: 35.171352
type: 'test'
...
# Subtest: 规范化是幂等的,不会反复改写已正确的 PEM
ok 49 - 规范化是幂等的,不会反复改写已正确的 PEM
---
duration_ms: 93.585148
type: 'test'
...
# Subtest: 损坏或非 PEM 内容会被判定为无效,而不是静默保存
ok 50 - 损坏或非 PEM 内容会被判定为无效,而不是静默保存
---
duration_ms: 45.896122
type: 'test'
...
# Subtest: 同一任务同一阶段的有效 lease 拒绝并发操作
ok 51 - 同一任务同一阶段的有效 lease 拒绝并发操作
---
duration_ms: 2.956083
type: 'test'
...
# Subtest: 过期 lease 会先收敛为 timed_out,再允许新的 attempt 接管
ok 52 - 过期 lease 会先收敛为 timed_out,再允许新的 attempt 接管
---
duration_ms: 0.652408
type: 'test'
...
# Subtest: 服务进程重建后从持久化记录恢复,并接管已过期的 build attempt
ok 53 - 服务进程重建后从持久化记录恢复,并接管已过期的 build attempt
---
duration_ms: 0.790237
type: 'test'
...
# Subtest: heartbeat 遇到过期上传 lease 时将任务阶段收敛为 timed_out
ok 54 - heartbeat 遇到过期上传 lease 时将任务阶段收敛为 timed_out
---
duration_ms: 0.830002
type: 'test'
...
# Subtest: 错误 lease 不能结束操作,正确 lease 结束上传后更新阶段状态
ok 55 - 错误 lease 不能结束操作,正确 lease 结束上传后更新阶段状态
---
duration_ms: 0.85031
type: 'test'
...
# Subtest: heartbeat 续租并更新日志,结束后的 attempt 拒绝迟到 heartbeat
ok 56 - heartbeat 续租并更新日志,结束后的 attempt 拒绝迟到 heartbeat
---
duration_ms: 1.451821
type: 'test'
...
# Subtest: 执行结束时 lease 已过期会持久化 timed_out,而不是回滚为 running
ok 57 - 执行结束时 lease 已过期会持久化 timed_out,而不是回滚为 running
---
duration_ms: 0.48344
type: 'test'
...
# Subtest: 上传工作目录位于系统临时目录,不会落在仓库内
ok 58 - 上传工作目录位于系统临时目录,不会落在仓库内
---
duration_ms: 1.278095
type: 'test'
...
# Subtest: miniprogram-ci 的相对路径缓存目录落在临时工作目录而不是仓库
ok 59 - miniprogram-ci 的相对路径缓存目录落在临时工作目录而不是仓库
---
duration_ms: 889.708804
type: 'test'
...
# Subtest: 上传会在临时工作目录下启动,失败也不会在仓库留下目录
ok 60 - 上传会在临时工作目录下启动,失败也不会在仓库留下目录
---
duration_ms: 35.854056
type: 'test'
...
# Subtest: 上传在独立进程执行,失败时返回可读错误且不抛出未捕获异常
ok 61 - 上传在独立进程执行,失败时返回可读错误且不抛出未捕获异常
---
duration_ms: 64.635283
type: 'test'
...
# Subtest: 上传超时会终止子进程并返回明确错误
ok 62 - 上传超时会终止子进程并返回明确错误
---
duration_ms: 5.145082
type: 'test'
...
# Subtest: miniprogram-ci compatibility patches keep overridden runtime APIs usable
ok 63 - miniprogram-ci compatibility patches keep overridden runtime APIs usable
---
duration_ms: 681.182262
type: 'test'
...
# Subtest: public default brand context fails fast when configuration is missing
ok 64 - public default brand context fails fast when configuration is missing
---
duration_ms: 2.103899
type: 'test'
...
# Subtest: every API route has an explicit authorization and success coverage contract
ok 65 - every API route has an explicit authorization and success coverage contract
---
duration_ms: 503.725354
type: 'test'
...
# Subtest: preview resources verify raster content and diagnose invalid or oversized assets
ok 66 - preview resources verify raster content and diagnose invalid or oversized assets
---
duration_ms: 84.808494
type: 'test'
...
# Subtest: preview resources reject image checksum drift and unavailable archives
ok 67 - preview resources reject image checksum drift and unavailable archives
---
duration_ms: 63.867568
type: 'test'
...
# Subtest: template preview matrix discovers newly added package manifests
ok 68 - template preview matrix discovers newly added package manifests
---
duration_ms: 14.07272
type: 'test'
...
# Subtest: template preview matrix keeps every deployed package, industry, and version isolated
ok 69 - template preview matrix keeps every deployed package, industry, and version isolated
---
duration_ms: 923.427842
type: 'test'
...
# Subtest: 模板版本按 SemVer 而不是导入时间判断最新版
ok 70 - 模板版本按 SemVer 而不是导入时间判断最新版
---
duration_ms: 1.899655
type: 'test'
...
# Subtest: 模板版本排序正确处理预发布版本和同版本稳定性
ok 71 - 模板版本排序正确处理预发布版本和同版本稳定性
---
duration_ms: 0.468962
type: 'test'
...
1..71
# tests 71
# suites 0
# pass 71
# fail 0
# cancelled 0
# skipped 0
# todo 0
# duration_ms 2561.461139
@@ -0,0 +1,11 @@
Running 2 tests using 1 worker
(node:297051) Warning: The 'NO_COLOR' env is ignored due to the 'FORCE_COLOR' env being set.
(Use `node --trace-warnings ...` to show where the warning was created)
(node:297051) Warning: The 'NO_COLOR' env is ignored due to the 'FORCE_COLOR' env being set.
(Use `node --trace-warnings ...` to show where the warning was created)
✓ 1 test/browser/admin-editor.spec.ts:235:1 › Admin 按通用预览目标筛选字段并同步品牌草稿 (22.4s)
✓ 2 test/browser/admin-editor.spec.ts:654:1 › 林境模板支持首页和主理人区域点选 (22.9s)
2 passed (46.2s)
@@ -0,0 +1,16 @@
Running 1 test using 1 worker
(node:297457) Warning: The 'NO_COLOR' env is ignored due to the 'FORCE_COLOR' env being set.
(Use `node --trace-warnings ...` to show where the warning was created)
(node:297457) Warning: The 'NO_COLOR' env is ignored due to the 'FORCE_COLOR' env being set.
(Use `node --trace-warnings ...` to show where the warning was created)
(node:297554) Warning: The 'NO_COLOR' env is ignored due to the 'FORCE_COLOR' env being set.
(Use `node --trace-warnings ...` to show where the warning was created)
(node:297665) Warning: The 'NO_COLOR' env is ignored due to the 'FORCE_COLOR' env being set.
(Use `node --trace-warnings ...` to show where the warning was created)
(node:297714) Warning: The 'NO_COLOR' env is ignored due to the 'FORCE_COLOR' env being set.
(Use `node --trace-warnings ...` to show where the warning was created)
✓ 1 test/browser/template-preview-media.spec.ts:154:1 › 导入包预览矩阵展示身份、资源和完整媒体槽位 (7.0s)
1 passed (7.9s)
File diff suppressed because it is too large. Load diff
Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 55 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 65 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 94 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 90 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 89 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 73 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 79 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 107 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 95 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 75 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 96 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 108 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 107 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 69 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 75 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 74 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 68 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 104 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 89 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 73 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 65 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 68 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 75 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 74 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 89 KiB

@@ -0,0 +1,7 @@
# 可视化编辑闭环
执行方案:docs/visual-editor-next-steps.md。
基线:feat/admin-component-preview / 541304a。
状态源:本目录 SUBTASKS.csv;旧 visual-editor 任务保留为历史。
当前仅完成规划,实现未开始。各子任务开始前建立 tasks 对应目录的 SPEC.md、TODO.csv、PROGRESS.md,补充具体验证命令和证据。
完成条件:全部子任务通过,业务内容有明确编辑入口,真实保存、发布隔离及生产部署验证完成。
@@ -0,0 +1,13 @@
# 进度记录
2026-10-09:与现有 ADR 0020、后续计划和交付清单对齐,制定四阶段实施计划。
2026-10-09:完成任务 1。盘点两套模板页面与 manifest / renderer 目标,修复餐饮首页身份区点选、咨询页字段过滤和首页业务目标 key;`pnpm validate:templates` 19 项通过,浏览器测试 2 项通过。
2026-10-09:完成任务 2、3、4。区域来源改为按 binding 推导;编辑面板改单列自适应;咨询表单字段可独立点选和编辑。Admin/Taro 类型检查与浏览器测试通过。
- 任务:可视化内容编辑闭环。
- 形态:epic。
- 进度:5/5 子任务完成。
- 当前:本轮计划已完成;后续可继续做真实数据库持久化和发布隔离验收。
- 验证:`pnpm validate:templates`、Admin/Taro typecheck、Admin build、`ADMIN_URL=http://localhost:3005 pnpm --filter @personal-brand/taro test:browser -- admin-editor.spec.ts` 均通过;计划 CSV 未纳入 Prettier 检查。
- 文件:.codex-tasks/visual-editor-closure/SUBTASKS.csv。
- 下一步:使用隔离品牌执行真实 API 保存、发布隔离和重载验证。
@@ -0,0 +1,6 @@
id,task,task_type,status,depends_on,task_dir,acceptance_criteria,validation_command,completed_at,retry_count,notes
1,逐页建立覆盖清单,single-full,DONE,,tasks/coverage,所有页面内容与字段对应且缺陷可复现,pnpm validate:templates; pnpm --filter @personal-brand/taro test:browser -- admin-editor.spec.ts,2026-10-09,0,已盘点两套模板页面;首批缺口已复现并修复:首页身份区目标、咨询品牌字段过滤、餐饮首页目标 key;契约 19 项和浏览器 2 项通过
2,修复通用选区绑定与模板发现,single-full,DONE,1,tasks/contract,混合来源及重复记录映射正确且契约测试通过,pnpm validate:templates; pnpm --filter @personal-brand/admin typecheck; 浏览器测试,2026-10-09,0,区域来源按 binding 推导;餐饮首页身份目标和业务卡片目标对齐;切页及记录失效选择已有清理逻辑
3,整理选区面板与保存交互,single-full,DONE,2,tasks/inspector,布局及失败和未保存切换验证通过,pnpm --filter @personal-brand/admin typecheck; 浏览器测试,2026-10-09,0,选区字段改单列自适应并移除固定最小高度;保持保存失败输入不重置
4,接通咨询字段编辑,single-full,DONE,2;3,tasks/inquiry,配置保存重载一致且历史提交不受损,pnpm --filter @personal-brand/admin typecheck; 浏览器测试,2026-10-09,0,咨询字段可独立点选并编辑标题、类型、必填、选项;预览草稿不提交真实咨询
5,全页面回归与部署验收,single-full,DONE,1;2;3;4,tasks/delivery,覆盖清单及工程门槛和部署验收通过,pnpm validate:templates; pnpm --filter @personal-brand/admin build; pnpm --filter @personal-brand/admin typecheck; pnpm --filter @personal-brand/taro typecheck; 浏览器测试,2026-10-09,0,模板契约 19 项、浏览器 2 项、Admin build、Admin/Taro typecheck 通过;CSV 不交给 Prettier
1 id task task_type status depends_on task_dir acceptance_criteria validation_command completed_at retry_count notes
2 1 逐页建立覆盖清单 single-full DONE tasks/coverage 所有页面内容与字段对应且缺陷可复现 pnpm validate:templates; pnpm --filter @personal-brand/taro test:browser -- admin-editor.spec.ts 2026-10-09 0 已盘点两套模板页面;首批缺口已复现并修复:首页身份区目标、咨询品牌字段过滤、餐饮首页目标 key;契约 19 项和浏览器 2 项通过
3 2 修复通用选区绑定与模板发现 single-full DONE 1 tasks/contract 混合来源及重复记录映射正确且契约测试通过 pnpm validate:templates; pnpm --filter @personal-brand/admin typecheck; 浏览器测试 2026-10-09 0 区域来源按 binding 推导;餐饮首页身份目标和业务卡片目标对齐;切页及记录失效选择已有清理逻辑
4 3 整理选区面板与保存交互 single-full DONE 2 tasks/inspector 布局及失败和未保存切换验证通过 pnpm --filter @personal-brand/admin typecheck; 浏览器测试 2026-10-09 0 选区字段改单列自适应并移除固定最小高度;保持保存失败输入不重置
5 4 接通咨询字段编辑 single-full DONE 2;3 tasks/inquiry 配置保存重载一致且历史提交不受损 pnpm --filter @personal-brand/admin typecheck; 浏览器测试 2026-10-09 0 咨询字段可独立点选并编辑标题、类型、必填、选项;预览草稿不提交真实咨询
6 5 全页面回归与部署验收 single-full DONE 1;2;3;4 tasks/delivery 覆盖清单及工程门槛和部署验收通过 pnpm validate:templates; pnpm --filter @personal-brand/admin build; pnpm --filter @personal-brand/admin typecheck; pnpm --filter @personal-brand/taro typecheck; 浏览器测试 2026-10-09 0 模板契约 19 项、浏览器 2 项、Admin build、Admin/Taro typecheck 通过;CSV 不交给 Prettier
@@ -0,0 +1,13 @@
template,page,visible_content,renderer_target,manifest_editor,source,status,evidence
acheng-campus-food,home,主理人身份、地点、出摊图片、餐品标题、首页操作按钮、承诺、业务卡片,food.home.identity; food.home.location; food.home.hero; food.home.offerings-heading; food.home.actions; food.home.promise-heading; acheng-campus-food.home.offering,对应 sections 已声明并补齐身份与操作目标,brand; offering; trust,已覆盖,契约测试 + 浏览器点选
acheng-campus-food,offerings,菜单说明、业务卡片,acheng-campus-food.offerings.menu; acheng-campus-food.offerings.item,对应 sections 已声明,brand; offering,已覆盖,契约测试 + 浏览器点选
acheng-campus-food,service,出摊说明、日程、配送、流程,acheng-campus-food.service.service; trust:schedule; trust:coverage; trust:process,对应 sections / trust declarations 已声明,brand; trust,待第二阶段复核,已存在浏览器点选路径
acheng-campus-food,profile,主理人与信任内容,acheng-campus-food.profile.identity; trust:credential; trust:case; trust:promise,对应 sections / trust declarations 已声明,brand; trust,待第二阶段复核,已存在 renderer target
acheng-campus-food,detail,餐品详情、详情说明,acheng-campus-food.detail.dishDetail; acheng-campus-food.detail.detailCopy,对应 sections 已声明,offering; brand,已覆盖,浏览器已验证底栏与编辑入口
acheng-campus-food,inquiry,页面文案、访客表单,acheng-campus-food.inquiry.booking,对应 section 已声明;Admin 已允许 inquiry section 编辑,brand; inquiry,首批已修复,浏览器已验证表单展示
acheng-campus-food,success,提交结果文案,acheng-campus-food.success.successCopy,对应 section 已声明,brand,待第二阶段复核,已验证页面可切换
acheng-campus-food,records,记录页文案,acheng-campus-food.records.recordsCopy,对应 section 已声明,brand; records,待第二阶段复核,已验证页面可切换
linjing-editorial,home,身份、主视觉、证明、主张、案例,editorial.home.identity; editorial.home.hero; editorial.home.proof; editorial.home.manifesto; editorial.home.works; linjing-editorial.home.home,对应 sections 已声明,brand; trust; offering,已覆盖,契约测试 + 浏览器点选
linjing-editorial,offerings,案例说明、业务卡片,linjing-editorial.offerings.cases; linjing-editorial.offerings.item,对应 sections 已声明,brand; offering,待第二阶段复核,已有 renderer target
linjing-editorial,profile,身份、履约、联系方式、信任内容,linjing-editorial.profile.identity; linjing-editorial.profile.profileDetails; trust:*,对应 sections / trust declarations 已声明,brand; trust,已覆盖,契约测试 + 浏览器点选
linjing-editorial,detail,案例详情、详情说明,linjing-editorial.detail.projectDetail; linjing-editorial.detail.detailCopy,对应 sections 已声明,offering; brand,待第二阶段复核,已有 renderer target
1 template page visible_content renderer_target manifest_editor source status evidence
2 acheng-campus-food home 主理人身份、地点、出摊图片、餐品标题、首页操作按钮、承诺、业务卡片 food.home.identity; food.home.location; food.home.hero; food.home.offerings-heading; food.home.actions; food.home.promise-heading; acheng-campus-food.home.offering 对应 sections 已声明并补齐身份与操作目标 brand; offering; trust 已覆盖 契约测试 + 浏览器点选
3 acheng-campus-food offerings 菜单说明、业务卡片 acheng-campus-food.offerings.menu; acheng-campus-food.offerings.item 对应 sections 已声明 brand; offering 已覆盖 契约测试 + 浏览器点选
4 acheng-campus-food service 出摊说明、日程、配送、流程 acheng-campus-food.service.service; trust:schedule; trust:coverage; trust:process 对应 sections / trust declarations 已声明 brand; trust 待第二阶段复核 已存在浏览器点选路径
5 acheng-campus-food profile 主理人与信任内容 acheng-campus-food.profile.identity; trust:credential; trust:case; trust:promise 对应 sections / trust declarations 已声明 brand; trust 待第二阶段复核 已存在 renderer target
6 acheng-campus-food detail 餐品详情、详情说明 acheng-campus-food.detail.dishDetail; acheng-campus-food.detail.detailCopy 对应 sections 已声明 offering; brand 已覆盖 浏览器已验证底栏与编辑入口
7 acheng-campus-food inquiry 页面文案、访客表单 acheng-campus-food.inquiry.booking 对应 section 已声明;Admin 已允许 inquiry section 编辑 brand; inquiry 首批已修复 浏览器已验证表单展示
8 acheng-campus-food success 提交结果文案 acheng-campus-food.success.successCopy 对应 section 已声明 brand 待第二阶段复核 已验证页面可切换
9 acheng-campus-food records 记录页文案 acheng-campus-food.records.recordsCopy 对应 section 已声明 brand; records 待第二阶段复核 已验证页面可切换
10 linjing-editorial home 身份、主视觉、证明、主张、案例 editorial.home.identity; editorial.home.hero; editorial.home.proof; editorial.home.manifesto; editorial.home.works; linjing-editorial.home.home 对应 sections 已声明 brand; trust; offering 已覆盖 契约测试 + 浏览器点选
11 linjing-editorial offerings 案例说明、业务卡片 linjing-editorial.offerings.cases; linjing-editorial.offerings.item 对应 sections 已声明 brand; offering 待第二阶段复核 已有 renderer target
12 linjing-editorial profile 身份、履约、联系方式、信任内容 linjing-editorial.profile.identity; linjing-editorial.profile.profileDetails; trust:* 对应 sections / trust declarations 已声明 brand; trust 已覆盖 契约测试 + 浏览器点选
13 linjing-editorial detail 案例详情、详情说明 linjing-editorial.detail.projectDetail; linjing-editorial.detail.detailCopy 对应 sections 已声明 offering; brand 待第二阶段复核 已有 renderer target
+25
View File
@@ -0,0 +1,25 @@
.agents
.aws
.claude
.codex
.codex-tasks
.git
.github
.turbo
.worktrees
coverage
dist
pnpm-lock.yaml.bak
docker-compose.override.yml
docker-compose.prod.yml
docs
media
node_modules
prototype
scripts/deploy/*.test.mjs
.env
.env.*
!.env.production.example
**/node_modules
**/dist
!apps/api/prisma/assets/**
+23 -4
View File
@@ -6,13 +6,32 @@ POSTGRES_DB=personal_brand
POSTGRES_PORT=5432
API_PORT=3001
API_PREFIX=
CORS_ORIGINS=http://localhost:3000
ADMIN_PORT=3000
SESSION_SECRET=replace-with-a-long-random-value
# 单实例使用 memory;多实例部署改用 postgres 并先执行数据库迁移
CLIENT_ERROR_THROTTLE_STORE=memory
DEFAULT_BRAND_ID=00000000-0000-0000-0000-000000000001
TEMPLATE_ARTIFACT_ROOT=/var/lib/personal-brand/template-artifacts
SEED_ADMIN_PASSWORD=change-me-now-123
OBJECT_STORAGE_ENDPOINT=
OBJECT_STORAGE_BUCKET=
OBJECT_STORAGE_ACCESS_KEY=
OBJECT_STORAGE_SECRET_KEY=
OBJECT_STORAGE_ENDPOINT=http://localhost:9000
OBJECT_STORAGE_PUBLIC_URL=http://localhost:9000/personal-brand-media
OBJECT_STORAGE_BUCKET=personal-brand-media
OBJECT_STORAGE_ACCESS_KEY=minioadmin
OBJECT_STORAGE_SECRET_KEY=minioadmin
WECHAT_APP_ID=
WECHAT_APP_SECRET=
WECHAT_UPLOAD_PRIVATE_KEY=
MINIAPP_CREDENTIAL_ENCRYPTION_KEY=replace-with-32-byte-random-secret
# 小程序代码构建产物根目录,相对路径按仓库根目录解析;默认 apps/taro/dist
# MINIAPP_ARTIFACT_ROOT=apps/taro/dist
# 构建超过该毫秒数没有进度更新即视为中断,允许重新上传;默认 15 分钟
# MINIAPP_BUILD_STALE_MS=900000
# 小程序请求地址在后台「小程序上传配置」维护,这里仅为回落值;
# 未设置时由 PUBLIC_BASE_URL + MINIAPP_API_PATH 推导
# MINIAPP_API_BASE_URL=https://wechat.app.que01.top/api
# MINIAPP_API_PATH=/api
# 单个品牌的 AppID 在后台“小程序上传配置”维护,这里只作为回落值
# WEAPP_APP_ID=
# 上传子进程工作目录;miniprogram-ci 的编译缓存放这里,默认系统临时目录
# MINIAPP_UPLOAD_WORKSPACE=/tmp/personal-brand-miniapp-upload
+40
View File
@@ -0,0 +1,40 @@
NODE_ENV=production
POSTGRES_USER=personal_brand
POSTGRES_PASSWORD=replace-with-a-long-database-password
POSTGRES_DB=personal_brand
POSTGRES_PORT=5432
DATABASE_URL=postgresql://personal_brand:replace-with-a-long-database-password@127.0.0.1:5432/personal_brand?schema=public
SESSION_SECRET=replace-with-at-least-32-random-characters
# 单实例使用 memory;多实例部署改用 postgres 并先执行数据库迁移
CLIENT_ERROR_THROTTLE_STORE=memory
DEFAULT_BRAND_ID=00000000-0000-0000-0000-000000000001
SEED_ADMIN_PASSWORD=replace-with-a-one-time-initial-password
SEED_MODE=skip
API_PORT=3001
API_PREFIX=
CORS_ORIGINS=
# 发布备份保留 7 份;定时备份默认保留 14 天
BACKUP_RETENTION_DAYS=14
# 可选:配置 rsync 目标后,每次定时备份会额外复制一份到异地
# 需要预先为 ubuntu 用户配置 SSH key;未配置时备份只保留在本机
# BACKUP_OFFSITE_TARGET=backup@example-host:/srv/personal-brand-backups/
LOCAL_MEDIA_ROOT=/home/ubuntu/persional-brand/media
LOCAL_MEDIA_BASE_URL=/media
OBJECT_STORAGE_ENDPOINT=
OBJECT_STORAGE_PUBLIC_URL=
OBJECT_STORAGE_BUCKET=
OBJECT_STORAGE_ACCESS_KEY=
OBJECT_STORAGE_SECRET_KEY=
OBJECT_STORAGE_REGION=us-east-1
WECHAT_APP_ID=
WECHAT_APP_SECRET=
# 小程序请求地址正常情况下在后台「小程序上传配置」维护;
# 这里仅作为后台未配置时的回落值(否则由 PUBLIC_BASE_URL + /api 推导)
# MINIAPP_API_BASE_URL=https://wechat.app.que01.top/api
# MINIAPP_BUILD_STALE_MS=900000
+178
View File
@@ -0,0 +1,178 @@
name: CI
on:
push:
branches: [main]
# 纯文档提交不占用 runner;需要状态时用 workflow_dispatch 手动触发。
paths-ignore:
- "**.md"
# PR 不设置 paths-ignore:branch protection 的 required checks 必须始终上报,
# 否则纯文档 PR 会永远等不到状态检查而无法合并。
pull_request:
workflow_dispatch:
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
env:
NODE_VERSION: "24"
PNPM_VERSION: "9.15.0"
# runner 任务容器把该路径 bind mount 到宿主机共享 store,避免每个 job 重复下载依赖。
npm_config_store_dir: /workspace/.pnpm-store
jobs:
static:
name: Static checks
runs-on: ubuntu-latest
timeout-minutes: 40
steps:
- uses: actions/checkout@v4
- name: Verify preinstalled toolchain
# 任务镜像已内置 Node 与 pnpm;不在这里下载 Node,避免 nodejs.org 慢连接拖死整个 job。
run: |
actual_node="$(node -p 'process.versions.node')"
actual_pnpm="$(pnpm --version)"
test "${actual_node%%.*}" = "$NODE_VERSION" || { echo "expected Node $NODE_VERSION.x, got $actual_node" >&2; exit 1; }
test "$actual_pnpm" = "$PNPM_VERSION" || { echo "expected pnpm $PNPM_VERSION, got $actual_pnpm" >&2; exit 1; }
- name: Restore Prisma engine cache
uses: actions/cache@v4
with:
path: ~/.cache/prisma
key: prisma-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('pnpm-lock.yaml') }}
restore-keys: |
prisma-${{ runner.os }}-${{ runner.arch }}-
- name: Restore Turbo cache
uses: actions/cache@v4
with:
path: .turbo/cache
key: turbo-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('pnpm-lock.yaml') }}-${{ github.sha }}
restore-keys: |
turbo-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('pnpm-lock.yaml') }}-
turbo-${{ runner.os }}-${{ runner.arch }}-
- run: pnpm install --frozen-lockfile
- run: pnpm check
- run: pnpm test:api-routes
- run: pnpm test:deploy
- run: pnpm validate:templates
- run: pnpm template:compatibility
- run: pnpm --filter @personal-brand/api exec tsx --test test/template-preview-matrix.test.ts
- run: pnpm template:conformance
- run: pnpm template:doctor
build:
name: Production build
runs-on: ubuntu-latest
timeout-minutes: 60
needs: [static]
steps:
- uses: actions/checkout@v4
- name: Verify preinstalled toolchain
# 任务镜像已内置 Node 与 pnpm;不在这里下载 Node,避免 nodejs.org 慢连接拖死整个 job。
run: |
actual_node="$(node -p 'process.versions.node')"
actual_pnpm="$(pnpm --version)"
test "${actual_node%%.*}" = "$NODE_VERSION" || { echo "expected Node $NODE_VERSION.x, got $actual_node" >&2; exit 1; }
test "$actual_pnpm" = "$PNPM_VERSION" || { echo "expected pnpm $PNPM_VERSION, got $actual_pnpm" >&2; exit 1; }
- name: Restore Prisma engine cache
uses: actions/cache@v4
with:
path: ~/.cache/prisma
key: prisma-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('pnpm-lock.yaml') }}
restore-keys: |
prisma-${{ runner.os }}-${{ runner.arch }}-
- name: Restore Turbo cache
uses: actions/cache@v4
with:
path: .turbo/cache
key: turbo-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('pnpm-lock.yaml') }}-${{ github.sha }}
restore-keys: |
turbo-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('pnpm-lock.yaml') }}-
turbo-${{ runner.os }}-${{ runner.arch }}-
- run: pnpm install --frozen-lockfile
- run: pnpm build
- run: pnpm build:admin:preview
- run: pnpm validate:template-release
browser-smoke:
name: Browser smoke
# 只在 PR 和手动触发时运行,避免 main 合并后重复消耗共享生产 runner。
if: github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- name: Verify preinstalled toolchain
# 任务镜像已内置 Node 与 pnpm;不在这里下载 Node,避免 nodejs.org 慢连接拖死整个 job。
run: |
actual_node="$(node -p 'process.versions.node')"
actual_pnpm="$(pnpm --version)"
test "${actual_node%%.*}" = "$NODE_VERSION" || { echo "expected Node $NODE_VERSION.x, got $actual_node" >&2; exit 1; }
test "$actual_pnpm" = "$PNPM_VERSION" || { echo "expected pnpm $PNPM_VERSION, got $actual_pnpm" >&2; exit 1; }
- name: Restore Prisma engine cache
uses: actions/cache@v4
with:
path: ~/.cache/prisma
key: prisma-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('pnpm-lock.yaml') }}
restore-keys: |
prisma-${{ runner.os }}-${{ runner.arch }}-
- run: pnpm install --frozen-lockfile
- name: Cache Playwright browsers
uses: actions/cache@v4
with:
path: ~/.cache/ms-playwright
key: playwright-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('pnpm-lock.yaml') }}
- name: Install Chromium
# 系统依赖与同版本 Chromium 已预装在 personal-brand-ci:node24 中;这里只做版本兜底。
run: pnpm --filter @personal-brand/taro exec playwright install chromium
- name: Run PR browser smoke
run: pnpm test:browser:smoke
api:
name: API integration
runs-on: ubuntu-latest
timeout-minutes: 45
services:
postgres:
image: postgres:16-alpine
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: personal_brand
options: >-
--health-cmd "pg_isready -U postgres -d personal_brand"
--health-interval 5s
--health-timeout 5s
--health-retries 12
env:
DATABASE_URL: postgresql://postgres:postgres@postgres:5432/personal_brand
DEFAULT_BRAND_ID: 00000000-0000-0000-0000-000000000001
SESSION_SECRET: ci-integration-session-secret-0123456789abcdef
SEED_ADMIN_PASSWORD: ci-integration-admin-password
steps:
- uses: actions/checkout@v4
- name: Verify preinstalled toolchain
# 任务镜像已内置 Node 与 pnpm;不在这里下载 Node,避免 nodejs.org 慢连接拖死整个 job。
run: |
actual_node="$(node -p 'process.versions.node')"
actual_pnpm="$(pnpm --version)"
test "${actual_node%%.*}" = "$NODE_VERSION" || { echo "expected Node $NODE_VERSION.x, got $actual_node" >&2; exit 1; }
test "$actual_pnpm" = "$PNPM_VERSION" || { echo "expected pnpm $PNPM_VERSION, got $actual_pnpm" >&2; exit 1; }
- name: Restore Prisma engine cache
uses: actions/cache@v4
with:
path: ~/.cache/prisma
key: prisma-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('pnpm-lock.yaml') }}
restore-keys: |
prisma-${{ runner.os }}-${{ runner.arch }}-
- run: pnpm install --frozen-lockfile
- name: Prepare API test env
working-directory: apps/api
run: |
cat > .env <<EOF
DATABASE_URL=$DATABASE_URL
DEFAULT_BRAND_ID=$DEFAULT_BRAND_ID
SESSION_SECRET=$SESSION_SECRET
SEED_ADMIN_PASSWORD=$SEED_ADMIN_PASSWORD
EOF
- run: pnpm --filter @personal-brand/api test:integration
+6
View File
@@ -0,0 +1,6 @@
#!/bin/sh
# 提交前让模板完成证据的源码哈希跟随当前工作树,避免额外的 chore 提交。
set -e
[ -f scripts/template-evidence-refresh.mjs ] || exit 0
command -v node >/dev/null 2>&1 || exit 0
node scripts/template-evidence-refresh.mjs --stage
+13 -1
View File
@@ -2,11 +2,13 @@ node_modules/
.pnpm-store/
.turbo/
dist/
packages/config/dist/
.next/
coverage/
.env
.env.*
!.env.example
.env.production
!.env.production.example
*.log
.DS_Store
apps/miniapp/miniprogram_npm/
@@ -14,8 +16,18 @@ apps/miniapp/project.private.config.json
.worktrees/
apps/taro/src/assets/
apps/admin/public/template-preview/
apps/taro/test-results/
apps/taro/playwright-report/
media/
**/.swc/
.codex-tasks/
!.codex-tasks/template-audit-execution/
!.codex-tasks/template-audit-execution/raw/
!.codex-tasks/template-audit-execution/raw/completion-evidence.json
docker-compose.override.yml
.env.production
apps/api/storage/
+1
View File
@@ -1,6 +1,7 @@
node_modules
.turbo
dist
apps/admin/public/template-preview
.next
prototype
pnpm-lock.yaml
+3
View File
@@ -1,11 +1,14 @@
# Product Direction
- 模板新增、绑定修改及宣称完成前,执行 pnpm template:doctor 并遵循 docs/template-completion-rules.md。静态校验、输入框出现、mock 成功不能单独证明完成;回归使用真实 manifest,按区域全部可见变量验收。
- The core product is a personal-brand platform whose primary goal is to build trust and convert that trust into qualified inquiries or collaborations.
- Personal-brand identity, positioning, proof of work, communication expectations, and contact paths are higher priority than any single industry workflow.
- Industry behavior is implemented as replaceable templates. Food, consulting, design, photography, and future industries must not hard-code their terminology or fields into the shared brand model or shared UI.
- The food template is supported, but it is an example template rather than the product definition.
- Backend configuration is the source of truth for brand content, services, template selection, trust-building content, and industry-specific fields. The mini program only renders configuration and submits user input.
- Template packages are the source of truth for template manifests, visual structure, default/sample content, field declarations, assets, and capabilities. Do not copy every template's sample data into Prisma seed or global database tables. A template's sample content may be copied into the database only when an administrator explicitly imports it for one specific brand; the resulting rows are brand content, not template registration.
- Templates have exactly one active package manifest/runtime contract. Do not add legacy readers, dual-write paths, inferred defaults, aliases, or silent fallbacks. Convert existing persisted data with a one-time, auditable migration that fails on ambiguity, then remove the old representation.
- `apps/api/prisma/seed.ts` may contain a small, explicit development fixture for the seeded demo brands, but it must never become the catalog of all templates or require one seed block per production template. New templates must be discoverable and validated from their package manifest without editing global seed data.
- Any delivered backend endpoint must have an automated test covering its authorization and successful behavior before it is considered complete.
- Keep personal-brand trust details explicit: biography, positioning, credentials, portfolio/proof, process, expectations, availability, contact methods, and clear follow-up status.
+146 -84
View File
@@ -1,104 +1,166 @@
# Project Status
最后更新:2026-09-19
## 当前目标
先为餐饮摊主朋友交付一个真正能带来订单的个人品牌小程序,再根据真实使用把通用能力产品化。产品方的收益、运营和平台化目标不能牺牲朋友的实际使用效果。
最后更新:2026-10-21
## 当前阶段
后端基础、数据库环境和订单 API 已完成首轮验证,管理后台和小程序静态页面已接入首版结构,下一步进行真实资源与微信登录/预约联调。
系统已从“餐饮试点小程序”演进为多模板个人品牌平台。当前已完成统一模板契约收口、模板完成证据门禁、品牌与页面方案拆分、管理员登录态撤销和 release 版本一致性修复。
## 已完成
ADR 0033 已落地:
- 产品 PRD、原型规格、架构决策、数据/API 设计和实施计划。
- 餐饮试点画像与首轮需求访谈决策。
- 可点击低保真原型:`prototype/index.html`。
- Git 仓库、`main` 分支和远程仓库。
- pnpm workspace + Turborepo Monorepo。
- TypeScript 严格配置、ESLint、Prettier、EditorConfig、环境变量模板。
- NestJS + Fastify API 骨架。
- Prisma PostgreSQL schema:品牌、服务、客户身份、订单、订单明细、标签、管理员。
- 微信官方 `jscode2session` 登录交换边界。
- 客户登录 token、客户订单提交/查询/取消。
- 普通套餐价格快照和私厨需求人工报价模型。
- 管理员账号密码登录和角色 token。
- 管理员订单列表、状态、未读、标签和内部备忘能力。
- DTO 校验、全局异常响应、请求 ID和订单状态流转规则。
- Docker PostgreSQL Compose、seed 和 Prisma 脚本说明。
- 初始 Prisma migration,已在本地 PostgreSQL 应用并验证数据库 schema up to date。
- seed 已写入品牌、服务、标签和管理员数据,并完成数量核验。
- 管理员订单详情、状态/未读/标签筛选和未读数量接口。
- API 自动化业务规则测试:订单创建、客户取消、状态流转和标签品牌隔离,共 6 项通过。
- 修复 ESM 下 `bcryptjs` 导入和 Fastify 请求 ID middleware 的运行时问题。
- API 已通过真实 HTTP 验证:健康检查、公开品牌/服务读取和管理员登录。
- HTTP 集成测试:公开接口、管理员登录、错误密码、管理员权限边界、客户会话、预约 DTO 校验、创建/取消和状态流转,共 8 项通过。
- OpenAPI 3.1 契约:`docs/openapi.yaml`,覆盖当前公开、客户和管理员接口。
- 类型化 `@personal-brand/api-client`:支持公开内容、客户预约、管理员订单和统一错误处理,并有 2 项客户端测试。
- 已根据 `/home/que01/桌面/个人品牌设计图/` 确认 C 端页面视觉规范:暖白、米黄、砖红、深炭黑,16px 卡片圆角和大字号优先。
- 小程序已完成首页、服务列表、预约套餐和我的订单静态页面,页面标题使用微信原生导航栏。
- 已配置小程序 AppID:`wxd75d946d6978d183`。
- 服务分类、预约数量步进器、订单状态卡和底部导航已按设计图完成首版还原。
- 已执行多轮 Codex 代码审查并修复关键认证和权限问题。
- “表达方式”已从 Admin 源码移除。
- “业务类型”和“页面方案”是两个独立概念。
- 新增“创建品牌”和“页面方案”页面。
- 创建品牌不会自动导入示例内容。
- `linjing-editorial` 只兼容 `doors`,不再兼容 `personal`。
## 最近提交
## 当前能力
- NestJS + Fastify API、Prisma PostgreSQL、全局 DTO 校验、统一错误响应和 `requestId`。
- 多品牌 Admin、品牌 membership、角色边界、品牌切换和品牌隔离。
- 创建品牌时按业务类型筛选兼容的页面方案;不兼容组合无法提交。
- 模板包发现、确定性打包、导入、校验、发布、预览、安装、升级和回滚。
- 三套已交付模板及其业务类型:
- `acheng-campus-food@1.0.3`:`food`
- `atelier-solopreneur@1.3.2`:`personal`
- `linjing-editorial@1.0.7`:`doors`
- Taro Runtime、Admin 组件预览、真实 manifest 驱动编辑、草稿/发布隔离。
- 发布备注为可选字段;空备注不会写入数据库,也不影响发布、回滚和公开内容。
- 依赖 override 的运行时兼容性通过 `miniprogram-ci` / Jimp / image-size / uuid smoke test 守卫。
- Gitea Actions CI 已在 `oracle_arm` 自托管 runner 上落地,`static` / `build` / `api` 三个 job 已完整通过(run 21);详见 `docs/ci.md`。
- 小程序构建、上传任务状态机、attempt lease 和失败记录。
- Admin/Customer token version:修改 admin 密码或调用 logout 后旧 token 立即失效;无 membership 的账号不会自动获得 owner 权限。
- `visualPresentation` 已进入唯一 `template.json` 契约,旧手写 visual manifest 优先路径已删除。
## 生产状态
当前生产 release:
```text
fee3c77 fix: 按设计图优化预约套餐数量和商品卡
13ead2d fix: 对齐服务分类和订单视觉结构
255756c feat: 增加小程序品牌首页
本次工作:数据库初始化、订单管理接口、业务规则测试和运行时修复
f2687c5 chore: prepare portable postgres development environment
0e8b8e1 feat: add api http conventions and booking state rules
0d4caab feat: add admin order tags and read state
bb5ccb1 feat: add admin authentication
b89853b fix: harden api authentication and validation
20261021034700-adcaa12970af
```
远程:`https://git.app.que01.top/que01/persionalBrand.git`
该 release 由提交 `adcaa12` 构建,包含后台渲染异常上报(`POST /admin/client-errors`,含去重与限流)、Admin 列表接口运行时响应契约校验,以及前序 release 的创建品牌与页面方案交互修复、Admin 渲染错误边界和异常数据容忍。部署后已完成公开路由健康检查,并确认未登录调用异常上报接口返回 `401 HTTP_401`,说明新接口已进入生产路由。
## 下一步优先级
生产健康检查:
1. 接入真实品牌图片、电话和微信配置,并替换当前图片占位区域。
2. 在微信开发者工具/真机完成 `wx.login`、预约提交、订单查询和取消联调。
3. 完善管理后台订单详情、筛选和状态处理视觉页面。
4. 继续补充页面截图回归和真实素材下的移动端溢出检查。
## 未决问题
- 普通套餐采用固定菜单、每日菜单,还是固定套餐加每日可用状态。
- 朋友最终品牌名称、图片、联系方式、营业时间和配送范围。
- 微信小程序主体、AppID、服务类目和订阅消息模板是否可用。
- 生产部署使用哪家 PostgreSQL、对象存储和 API 托管服务。
- 当前 token 是开发阶段的签名 Bearer token;生产前应替换为带撤销能力的正式 session/Cookie 方案。
## 当前明确不做
- 支付、退款、发票、财务对账。
- 复杂库存、自动配送判断和每日菜单编排。
- 多商户注册、套餐计费、会员和营销系统。
- 自动发布微信小程序。
## 跨电脑恢复
```bash
git clone https://git.app.que01.top/que01/persionalBrand.git
cd persionalBrand
cat PROJECT_STATUS.md
cat agent.md
cp .env.example .env
```text
api=online
pm2-autostart=enabled
admin=active
database=running
backups=7
/admin/ 200
/template-preview/ 200
/api/health 200
/media/seed/food-package-02.jpg 200
/admin/client-errors(无登录态) 401
```
有 Docker 的机器再执行:
生产数据库已应用全部 48 个 Prisma migration,schema 为 up to date。
```bash
docker compose up -d postgres
pnpm install
pnpm db:migrate
pnpm db:seed
三个生产品牌的当前发布快照:
| 品牌 | 业务类型 | 页面方案 | 发布版本 |
| ---------------- | ---------- | --------------------------- | ------------ |
| `atelier-studio` | `personal` | `atelier-solopreneur@1.3.2` | `v2 current` |
| `default-brand` | `food` | `acheng-campus-food@1.0.3` | `v2 current` |
| `linjing-doors` | `doors` | `linjing-editorial@1.0.7` | `v3 current` |
## 完成证据
`.codex-tasks/template-audit-execution/raw/completion-evidence.json` 登记四类证据:
- `real-manifest-interaction`
- `save-reload-publish-isolation`
- `visual-reference`
- `empty-error-branches`
每条证据保留执行命令、日志和产物 SHA-256。`pnpm template:doctor` 会校验证据覆盖和哈希;当前三套模板均为:
```text
staticStatus=pass
completionStatus=complete
unresolvedIssues=0
```
## 更新规则
Admin 浏览器回归新增 `apps/taro/test/browser/brand-creation-and-page-scheme.spec.ts`,覆盖:
每完成一个可验证的开发任务,更新“当前阶段”“已完成”“最近提交”和“下一步优先级”。只记录已经发生或已经确认的事实;未确认内容放入“未决问题”。
- 创建品牌时按业务类型筛选页面方案。
- `personal` 不出现林境页面方案。
- 切换业务类型后清除不兼容的页面方案选择,提交按钮禁用。
- 创建失败时保留用户输入并显示错误。
- 页面方案切换和升级提交正确版本、校验和与冲突保留参数。
- 操作成功后刷新工作区、页面方案选项和升级预览查询。
`apps/taro/test/browser/publication-release.spec.ts` 覆盖内容与发布流程:
- 发布按钮按 readiness 启用;空备注发布提交空 body,不写入 `note`。
- 备注提交前去除首尾空格。
- 发布失败时保留备注与确认弹窗,并显示服务端错误。
- 撤回当前版本、恢复历史版本分别提交正确路径与版本号。
- 小程序配置页从服务端回填设置,只提交用户新输入的私钥。
该回归同时发现并修复了 `MiniAppSettingsTab` 的 `Form` 实例归属问题:表单实例原本在父组件创建、子组件懒挂载,触发 antd `useForm` 未连接警告;现已下沉到配置页自身。
## Admin 渲染错误边界
后台此前没有任何 React error boundary:任一页面在渲染阶段抛错(例如接口返回了形状不符的数据)都会导致整页白屏,用户只能从控制台看到堆栈。现在按两级兜底:
- `Root` 上的整页边界:后台外壳自身渲染失败时显示错误页,提供「重新加载页面」和「返回概览」。
- `Dashboard` 内容区的页面边界:单个业务页面失败时保留侧边栏与顶部导航,提供「重试」和「重新加载页面」,切换路由后自动复位。
- 错误页展示可复制的错误编号,日志侧输出同一编号、堆栈与组件栈,便于把用户反馈和服务器日志对应起来。
- 开发环境额外显示原始错误信息;生产环境不暴露堆栈。
外壳数据不再直接信任接口形状:`apps/admin/src/lib/brand-switcher.ts` 只接受完整成员记录,跳过异常条目并对重复品牌、缺失名称和非字符串品牌名做稳定收敛,避免单条脏数据让整个后台外壳崩溃。错误边界只作为最后一道防线。
`apps/taro/test/browser/admin-error-boundary.spec.ts` 覆盖:
- 品牌成员与品牌名称返回异常结构时,后台外壳仍正常渲染。
- 业务页面数据异常时保留导航,重试仍失败保持错误页,重新加载后恢复。
`apps/admin/test/brand-switcher.test.mjs` 覆盖选项转换的异常条目、非数组、重复品牌、缺失名称与非字符串名称。
## Ant Design 6 弃用项
- `Alert` 统一使用 `title`,`Space` 统一使用 `orientation`。
- 提示与确认框改为 `App.useApp()` 实例,删除静态 `message` 转出口 `components/AdminMessage.ts`。
- `apps/admin/test/antd-deprecations.test.mjs` 作为静态门禁,阻止静态 `message`、`Modal.confirm`、`Alert.message`、`Space.direction` 回流。
- `List` 仍保留:`Listy` 是虚拟滚动组件,API 不兼容,当前仅用于小数据量场景;已记录在 `docs/adr/0034-antd6-static-api-and-list.md`,升级 Ant Design 7 前重新评估。
## 已验证门禁
- `pnpm check`
- `pnpm validate:template-release`
- `pnpm --filter @personal-brand/api test`
- `pnpm --filter @personal-brand/api test:integration`
- `miniprogram-ci` override 兼容 smoke test
- `pnpm test:api-client`
- `pnpm test:deploy`
- `pnpm --filter @personal-brand/admin typecheck`
- `pnpm --filter @personal-brand/admin lint`
- `pnpm --filter @personal-brand/admin test`
- `pnpm --filter @personal-brand/admin build`
- `pnpm build`
- `pnpm template:doctor`
- Playwright:
- `brand-creation-and-page-scheme.spec.ts`
- `publication-release.spec.ts`
- `admin-error-boundary.spec.ts`
- `template-preview-media.spec.ts`
- `admin-editor.spec.ts`
发布脚本的 Node 版本门禁已提前到所有构建之前。Node 22 下执行 `pnpm deploy:release` 会立即失败,并给出 Node.js 24 要求提示,不再先执行一轮无用构建。
## 安全审计
- `pnpm audit --prod --registry=https://registry.npmjs.org` 已完成。
- 可修复 advisory 已通过 `pnpm.overrides` 收敛;`request` 替换为 `@cypress/request@4.0.1`。
- 剩余 8 条为 `miniprogram-ci@2.1.31` 无修复版本的上游 advisory,已在 `pnpm.auditConfig.ignoreGhsas` 和 `docs/security-audit.md` 中显式登记风险、控制措施与跟进条件。
- Taro 官方 peer 仍声明 Vite 4;当前使用 Vite 6.4.3,H5 与 Weapp 实际构建均通过,peer warning 记录在安全审计文档。
## 未决事项
- `miniprogram-ci` 上游发布修复版本后,需要移除对应的 audit ignore、风险登记和本地 patch。
- Gitea SSH 直连仍受 OCI 安全列表限制;当前本机通过 `oracle_arm` ProxyCommand 转发访问,不阻塞业务。
- CI 已加入 audit 和三套模板矩阵构建;后续可继续拆分更细粒度的 smoke/visual matrix。
+2
View File
@@ -2,3 +2,5 @@ VITE_APP_BASE_PATH=/admin/
VITE_API_BASE_URL=/api
VITE_DEV_API_TARGET=http://localhost:3001
ADMIN_PORT=3000
VITE_TEMPLATE_PREVIEW_URL=http://localhost:3002
VITE_MEDIA_PROXY_TARGET=http://localhost:9000
+420
View File
@@ -0,0 +1,420 @@
# Admin Design Language
本文件是 `@personal-brand/admin` 管理后台的视觉与交互规范,是后台 UI 的唯一设计来源。
设计目标:**简洁、干净**。留白充足、层级靠排版建立、装饰最少。信息架构与业务语义不在本文件范围内,如需变更请走产品文档。
适用范围:`apps/admin/src` 下所有页面、组件与样式。新增 UI 前先读本文件,冲突以本文件为准。
- 本文件同时作为 AI 设计工具的规范输入:在 MasterGo「AI 快搭」中直接上传本文件即可,无需重复描述视觉规则。生成提示词见 `docs/design/admin-mastergo-guide.md`。
- 技术约束:antd 6 + React 19 + React Router 7 + TanStack Query 5。不引入新的 UI 库、状态管理、校验或路由方案。
- 主题令牌统一在根节点通过 `ConfigProvider` 注入,页面与组件内不得写零散色值。
- 共享视觉元素放 `apps/admin/src/components/`,页面专属组件留在各自的 `features/` 目录。
- 中文界面。桌面优先,最小可用宽度 1024px;窄屏允许侧栏折叠,不提供移动端专用布局。
---
## 1. 颜色
中性灰打底,只保留一个强调色。禁止渐变、彩色大面积色块、玻璃拟态。
### 基础色
| 用途 | 令牌 | 值 |
| ---------------------- | ---------------------- | --------- |
| 页面底色 | `colorBgLayout` | `#F7F8FA` |
| 卡片/容器底色 | `colorBgContainer` | `#FFFFFF` |
| 次级填充(表头、悬停) | `colorFillQuaternary` | `#FAFAFB` |
| 悬停底色 | `colorFillTertiary` | `#F7F8FA` |
| 容器边框 | `colorBorderSecondary` | `#E7E9EC` |
| 行分隔线 | `colorSplit` | `#F0F1F3` |
| 控件边框 | `colorBorder` | `#D8DBE0` |
### 文字色
| 用途 | 令牌 | 值 |
| ------------- | --------------------- | --------- |
| 主文字 | `colorText` | `#1C1F23` |
| 次要文字 | `colorTextSecondary` | `#6B7280` |
| 辅助/占位文字 | `colorTextTertiary` | `#9AA1AC` |
| 禁用文字 | `colorTextQuaternary` | `#C3C7CF` |
### 强调色
| 用途 | 令牌 | 值 |
| ------------- | -------------------- | --------- |
| 主色 | `colorPrimary` | `#2563EB` |
| 主色悬停 | `colorPrimaryHover` | `#1D4ED8` |
| 主色按下 | `colorPrimaryActive` | `#1E40AF` |
| 选中底色 | `colorPrimaryBg` | `#EFF4FF` |
| 选中/链接文字 | `colorLink` | `#2563EB` |
强调色只用于:主按钮、选中态、链接、关键数字、聚焦描边。不得用于大面积背景。
例外:小程序预览区(iframe / 模拟器内)显示的是模板自身的品牌色(例如餐饮模板的砖红 `#B54A2C`),与后台无关,不视为违规,也不要「修正」成后台强调色。
### 状态色
状态一律用「浅底 + 深字」,不使用 antd 的实心鲜艳 Tag。
| 语义 | 底色 | 边框 | 文字色 |
| ------------- | --------- | --------- | --------- |
| 成功 / 已发布 | `#ECFDF3` | `#ABEFC6` | `#067647` |
| 警告 / 进行中 | `#FFFAEB` | `#FEDF89` | `#B54708` |
| 错误 / 失败 | `#FEF3F2` | `#FBD5D1` | `#B42318` |
| 中性 / 草稿 | `#F2F4F7` | `#E7E9EC` | `#475467` |
| 信息 / 系统态 | `#EFF4FF` | `#B2CCFF` | `#2563EB` |
- 底色 + 边框 + 深色文字三件套同时用于 `StatusTag`、`Alert`、错误条与空状态,不得混用其他色阶。
- 需要中间调的场合(图标、进度条完成态)使用中间色:成功 `#12B76A`、警告 `#F79009`、错误 `#F04438`、信息 `#2563EB`。
---
## 2. 排版
系统无衬线字体栈:`Inter`、`PingFang SC`、`Noto Sans SC`、`sans-serif`。
| 角色 | 字号 | 字重 | 行高 |
| ------------------ | ---- | ---- | ---- |
| 页面标题 | 20px | 600 | 1.4 |
| 区块/卡片标题 | 16px | 600 | 1.45 |
| 卡片内对象主标题 | 18px | 600 | 1.45 |
| 强调正文、品牌名 | 15px | 600 | 1.5 |
| 正文 | 14px | 400 | 1.5 |
| 表单标签、次要正文 | 13px | 400 | 1.5 |
| 辅助说明、时间戳 | 12px | 400 | 1.5 |
| 指标数值 | 28px | 600 | 1.2 |
- 层级靠字号与字重建立,不靠颜色、下划线、边框。
- 中文不使用斜体;英文与数字不加字距。
- 一段说明文字最长不超过 2 行,超出应改写或省略。
- 中英文与数字之间保留一个空格。
---
## 3. 间距与布局
8pt 网格。间距只使用 `4 / 8 / 12 / 16 / 24 / 32`。
| 场景 | 值 |
| ---------------- | ------------ |
| 页面内容区内边距 | 24px |
| 内容最大宽度 | 1200px,居中 |
| 页面头部到主体 | 32px |
| 卡片内边距 | 20px |
| 卡片之间 | 16px |
| 表单字段之间 | 16px |
| 标签与输入框之间 | 6px |
| 行内元素之间 | 8px |
| 小节标题到内容 | 12px |
外壳尺寸:
- 侧栏宽 232px,折叠宽 0(`breakpoint="lg"`)。
- 顶栏高 56px,与侧栏品牌区对齐。
---
## 4. 形状与层次
| 元素 | 圆角 | 说明 |
| ------------------ | ---- | ------------------------------- |
| 卡片 | 10px | 默认 1px `#E7E9EC` 边框,无阴影 |
| 弹窗 | 12px | 极轻阴影 |
| 按钮、输入框、下拉 | 6px | 统一 |
| 状态标签 | 6px | 高 24px,内边距 `2px 8px` |
| 图片/头像缩略图 | 8px | 头像用圆形 |
| 进度条 | 3px | 高 6px |
- 层次手段优先级:留白 > 字号字重 > 1px 浅边框 > 阴影。
- 阴影仅用于浮层:`0 1px 2px rgba(16, 24, 40, 0.04)`,弹窗可加 `0 8px 24px rgba(16, 24, 40, 0.08)`。
- 卡片不使用阴影,不叠加边框与阴影。
---
## 5. 组件规范
### 侧栏导航
- 白底,右侧 1px `#E7E9EC` 分隔线。不使用深色主题(现有 `theme="dark"` 需移除)。
- 顶部品牌区:24x24 圆角 6px 标识 + 品牌名,高 56px。
- 分组标题:12px `#9AA1AC`,上下留白 8px,不加图标、不做大写英文。
- 菜单项:高 36px,圆角 6px,左侧 16px 线性图标(描边 1.5px),文字 14px。
- 三态:默认深灰文字无底色;悬停 `#F7F8FA`;选中 `#EFF4FF` 底 + `#2563EB` 文字与图标 + 字重 500。
### 顶栏
- 高 56px,白底,底部 1px 分隔线,左右内边距 24px。
- 左侧:品牌名 14px/600 + 灰色 13px「品牌工作区」+ 角色标签。
- 角色标签:负责人 `#EFF4FF`/`#2563EB`,内容编辑 `#F2F4F7`/`#475467`。
- 右侧:品牌切换下拉(尺寸 `small`、白底细边框)+ 「退出登录」文字按钮。
- 顶栏不随机滚动,内容区独立滚动。
### 页面头部
统一通过 `AdminPageHeader` 渲染:页面标题 20px/600 + 可选副标题 13px 次要色 + 右侧操作区。标题与副标题间距 6px,页头到主体 32px(明显大于卡片之间的 16px)。页面内不得再手写标题层级。
- 页面标题必须与侧栏导航用词一致,不额外添加「小程序内容:」这类前缀;页面职责写进副标题。
- 副标题一句话讲清这一页做什么,最长不超过 2 行;能由页面内文案表达的细节不要重复写在这里。
### 卡片
- 标题 16px/600,标题区底部间距 12px,标题右侧放次要操作(文字按钮)。
- 卡片只承载一个主题;一个页面最多两级卡片嵌套,避免再嵌套。
### 按钮
| 类型 | 场景 |
| -------------------- | ---------------------------------------- |
| 主按钮(实心强调色) | 每个页面/卡片最多一个,用于当前主流程 |
| 次按钮(白底细边框) | 并列的次要操作 |
| 文字按钮 | 表格行内操作、列表「去处理」、返回类操作 |
| 危险按钮 | 删除、撤回、卸载等不可逆操作 |
- 高度:默认 32px,主流程按钮 40px。
- 等待态用 `loading`,禁用态用 `disabled`,禁止用文字变形表达状态。
### 表单
- 标签在输入框上方,13px `#475467`,必填星号 `#B42318`。
- 帮助文本 12px `#9AA1AC`,错误文本 12px `#B42318`,都显示在字段下方。
- 输入框聚焦:1.5px `#2563EB` 描边 + `#EFF4FF` 2px 外发光。
- 提交失败必须保留用户输入,错误提示定位到字段或表单顶部,禁止弹窗后清空。
### 数据表格
- 无竖线;表头底色 `#FAFAFB`,13px `#6B7280`。
- 行高 52px(含头像/双行内容时 60px)。
- 行分隔线 `#F0F1F3`;悬停行底色 `#FAFAFB`。
- 操作列统一放最右,使用文字按钮,最多 2 个直接操作,更多收进「更多」下拉。
- 空数据不显示空表头,改用空状态组件。
### 状态标签
- 统一组件,按语义取色,默认 `尺寸 = 24px 高 / 12px 字`。
- 发布状态机映射:`building` 信息、`uploaded` 中性、`under_review` 警告、`approved` 成功、`rejected` 错误、`published` 成功、`failed` 错误、`superseded` 中性。
- 同一列表内标签宽度尽量对齐,避免视觉跳动。
### 弹窗
- 宽 480px(简单表单)或 560px(多字段),圆角 12px。
- 标题 16px/600,底部操作右对齐:次按钮在左、主按钮在右。
- 提交中禁用关闭与重复提交。
### 描述列表(键值展示)
用于咨询详情、版本信息等只读信息:字段名 13px `#6B7280`,值 14px `#1C1F23`,行间距 12px,不使用表格线。
落地:`<Descriptions className="admin-descriptions" column={1} size="small">`,字号与间距由 `admin.css` 与 `Descriptions` 令牌统一,不逐处传 `bordered`。
### Tabs
- 顶部 1px 分隔线,选中项底部 2px 强调色下划线 + 深色文字,未选中 14px `#6B7280`。
- 不超过 5 个 Tab,超出改用左侧分段导航。
### 切换控件选型
同一层级切换控件只允许两种,按范围选择,不得混用:
| 场景 | 控件 | 现状 |
| ---------------------------------------- | ----------- | ------------------------------ |
| 页面级分区(内容结构不同、各自独立成段) | `Tabs` | 配置与发布 |
| 区块内视图切换(同一份数据换视角) | `Segmented` | 小程序页面、业务提供项编辑弹窗 |
`Segmented` 用作「取值选择」(如能力状态降级/启用/停用)时按表单控件处理,不受本表约束。
### 标题层级
页面内标题只用三档,禁止再用 `Typography.Title level` 直接指定字号:
| 用途 | 类名 | 字号 |
| ---------------------- | --------------------- | ---------- |
| 区块标题 | `admin-section-title` | 16px / 600 |
| 面板内小标题、表单分组 | `admin-subhead` | 15px / 600 |
| 列表行、条目名称 | `admin-row-title` | 14px / 600 |
页面级标题只由 `AdminPageHeader` 输出(20px / 600),一个页面只出现一次。
### 进度
- 高 6px,圆角 3px,轨道 `#F0F1F3`,进度条强调色;完成态用成功色。
- 进度条上方 14px 文案说明当前含义,不允许只有一根进度条。
---
## 6. 状态设计
每个远程数据页面必须显式实现四种状态,不得出现无反馈的白屏。
| 状态 | 规范 |
| -------- | ----------------------------------------------------------------------------------- |
| 加载中 | 骨架屏,形状与最终内容一致;不用居中转圈 |
| 空数据 | 居中:极简线性图形 + 15px/600 标题 + 13px 灰色说明 + 主操作按钮 |
| 请求失败 | 卡片内错误条:`#FEF3F2` 底 + 1px 浅红边框 + 圆角 8px + 文案 14px + 「重试」文字按钮 |
| 成功反馈 | 右上角轻量 toast,白底圆角 8px,280–320px 宽 |
- 行内操作使用按钮 `loading` 表达进行中,不用全局遮罩。
- 提交成功后:关闭弹窗、重置表单、刷新受影响列表;提交失败保持原状。
- 幂等写操作要防止重复点击(提交中禁用)。
落地约定:
- 空状态统一用 `EmptyState`(`components/EmptyState.tsx`);表格内用 `compact` 变体,整块区域用默认变体。禁止再使用 antd 默认 `Empty` 插画。
- 列表 / 表格加载统一用 `TableSkeleton`、`ListSkeleton`(`components/TableSkeleton.tsx`)替换内容区,不使用 antd `Table` 的转圈遮罩;卡片级加载用 `LoadingStack`。
- 卡片内的写操作只在「有未保存修改」时使用主按钮,其余状态用次要按钮并禁用,同时用 `StatusTag` 标明修改状态。
- 发布准备度、内容检查这类清单,条目文案只描述「检查什么」(中性名词),是否达标由「已完成 / 待完善」标签表达;帮助文案只在待完善时展示。禁止出现「已完成 · 请先完善…」这类自相矛盾的措辞。
---
## 7. 页面结构
以下为各页面的视觉结构约定,业务逻辑不变。
| 页面 | 结构要点 |
| -------------- | ---------------------------------------------------------------------------------------------------------------------- |
| 登录 | 居中 400px 卡片,标识 + 说明 + 表单 + 通栏主按钮;错误态展示在字段下方 |
| 首次改密 | 同登录卡片形态,说明文案 + 三个密码字段 + 「保存新密码」 |
| 品牌概览 | 品牌卡 + 三张指标卡(等宽一行)+ 两栏(发布准备度 / 品牌内容检查) |
| 内容与发布 | 内容发布 / 小程序发布 / 小程序配置三个分区;内容发布含发布状态卡、草稿卡和历史版本表,不承载业务类型或页面方案选择 |
| 页面方案 | 当前业务类型与页面方案 + 升级预览 + 版本选择 + 配置恢复 + 高级示例内容导入 |
| 品牌管理 | 品牌列表与创建入口;创建品牌先选不可变的业务类型,再选兼容页面方案,创建时不导入示例内容 |
| 小程序页面 | 左右两栏:左 380px 编辑面板,右预览画布;预览内选中区域虚线高亮 + 区域名气泡 |
| 信任内容 | 列表行(类型图标或配图 + 标题 + 发布状态标签 + 类型/展示位置说明 + 两行摘要 + 行内操作),按模板类型顺序排列,不用表格 |
| 业务提供项 | 表格(名称 / 价格 / 状态开关 / 排序 / 操作)+ 新增弹窗 |
| 咨询记录 | 顶部三指标 + 左 380px 列表 + 右详情的主从布局 |
| 咨询表单与字段 | 咨询表单表(名称 / 版本 / 字段数 / 状态 / 操作)+ 新增与编辑弹窗(含选项编辑);高级自定义字段表 + 新增弹窗 |
| 能力插件 | 插件卡片列表(图标 + 名称 + 说明 + 开关),停用态降低对比度 |
| 团队成员 | 表格(成员 / 角色 / 状态 / 最近登录 / 操作)+ 邀请弹窗 |
两栏页面在小屏下折叠为单列,编辑/预览改为上下排列。
---
## 8. 无障碍与细节
- 正文与背景对比度不低于 4.5:1;标签文字与标签底色不低于 4.5:1。
- 可点击元素最小热区 32x32px;纯图标按钮必须带 `aria-label`。
- 焦点可见:所有可交互元素保留 1.5px 强调色聚焦描边。
- 状态不能只靠颜色区分,需同时有文字。
- 数字使用等宽数字排版(`font-variant-numeric: tabular-nums`),避免指标和价格跳动。
---
## 9. 禁止项
- 渐变、玻璃拟态、拟物纹理、装饰性插画铺满界面。
- 深色侧栏、彩色大面积色块、实心鲜艳 Tag。
- 重阴影、多重边框、卡片再套卡片超过两级。
- emoji 作为图标;图标与文字混排时不对齐基线。
- 页面内写死色值、圆角、间距魔法数字。
- 一个页面出现多个主按钮竞争视觉焦点。
---
## 10. antd 令牌映射
落地时在 Admin 根节点用 `ConfigProvider` 注入,不逐页覆盖。
```ts
const theme = {
token: {
colorPrimary: "#2563EB",
colorLink: "#2563EB",
colorText: "#1C1F23",
colorTextSecondary: "#6B7280",
colorTextTertiary: "#9AA1AC",
colorTextQuaternary: "#C3C7CF",
colorBgLayout: "#F7F8FA",
colorBgContainer: "#FFFFFF",
colorBorder: "#D8DBE0",
colorBorderSecondary: "#E7E9EC",
colorSplit: "#F0F1F3",
colorFillTertiary: "#F7F8FA",
colorFillQuaternary: "#FAFAFB",
colorSuccess: "#12B76A",
colorSuccessBg: "#ECFDF3",
colorSuccessBorder: "#ABEFC6",
colorSuccessText: "#067647",
colorWarning: "#F79009",
colorWarningBg: "#FFFAEB",
colorWarningBorder: "#FEDF89",
colorWarningText: "#B54708",
colorError: "#F04438",
colorErrorBg: "#FEF3F2",
colorErrorBorder: "#FBD5D1",
colorErrorText: "#B42318",
colorInfo: "#2563EB",
colorInfoBg: "#EFF4FF",
colorInfoBorder: "#B2CCFF",
colorInfoText: "#2563EB",
borderRadius: 6,
borderRadiusLG: 10,
borderRadiusSM: 4,
fontSize: 14,
fontFamily:
"Inter, 'PingFang SC', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif",
controlHeight: 32,
controlHeightLG: 40,
boxShadow: "0 1px 2px rgba(16, 24, 40, 0.04)",
boxShadowSecondary: "0 8px 24px rgba(16, 24, 40, 0.08)",
wireframe: false,
},
components: {
Layout: {
headerHeight: 56,
headerBg: "#FFFFFF",
headerPadding: "0 24px",
siderBg: "#FFFFFF",
bodyBg: "#F7F8FA",
triggerBg: "#FFFFFF",
triggerColor: "#475467",
triggerHeight: 40,
},
Menu: {
itemHeight: 36,
itemBorderRadius: 6,
itemBg: "transparent",
itemColor: "#475467",
itemHoverBg: "#F7F8FA",
itemHoverColor: "#1C1F23",
itemSelectedBg: "#EFF4FF",
itemSelectedColor: "#2563EB",
itemMarginInline: 8,
itemMarginBlock: 2,
groupTitleColor: "#9AA1AC",
groupTitleFontSize: 12,
collapsedWidth: 0,
subMenuItemBg: "transparent",
},
Card: { paddingLG: 20, headerFontSize: 16, headerHeight: 52, headerHeightSM: 44 },
Table: {
headerBg: "#FAFAFB",
headerColor: "#6B7280",
rowHoverBg: "#FAFAFB",
headerSplitColor: "transparent",
borderColor: "#F0F1F3",
cellPaddingBlock: 16,
headerBorderRadius: 8,
},
Button: { fontWeight: 500, primaryShadow: "none", defaultShadow: "none" },
Progress: { defaultColor: "#2563EB", remainingColor: "#F0F1F3", lineBorderRadius: 3 },
Tag: { defaultBg: "#F2F4F7", defaultColor: "#475467", borderRadiusSM: 6 },
Tabs: { inkBarColor: "#2563EB", itemSelectedColor: "#1C1F23", itemColor: "#6B7280" },
Form: { labelColor: "#475467", labelFontSize: 13, verticalLabelPadding: "0 0 6px" },
Modal: { borderRadiusLG: 12 },
Statistic: { titleFontSize: 12, contentFontSize: 28 },
Alert: { borderRadius: 8 },
Descriptions: {
labelBg: "#FAFAFB",
labelColor: "#6B7280",
contentColor: "#1C1F23",
itemPaddingBottom: 12,
},
},
};
```
可执行来源是 `apps/admin/src/lib/theme.ts`,本块为同值快照;改令牌时两处一起改。
- 新增页面优先使用令牌与共享组件;禁止在 JSX 内写内联色值、字号、圆角(唯一的例外是通过 CSS 变量透传的数据色,例如视觉模板色板的 `--swatch-color`)。
- 共享视觉组件清单:`AdminPageHeader`、`AdminSection`、`StatusTag`、`EmptyState`、`TableSkeleton` / `ListSkeleton`、`MetricCard`、`QueryState`。
+4
View File
@@ -3,6 +3,10 @@
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width,initial-scale=1" />
<meta
http-equiv="Content-Security-Policy"
content="default-src 'self'; img-src 'self' data: blob:; media-src 'self' data: blob:; style-src 'self' 'unsafe-inline'; font-src 'self' data:; connect-src 'self' ws: wss:; script-src 'self'; object-src 'none'; base-uri 'none'; form-action 'self'"
/>
<title>个人品牌后台</title>
</head>
<body>
+1
View File
@@ -3,6 +3,7 @@
"private": true,
"type": "module",
"dependencies": {
"@ant-design/icons": "^6.3.4",
"@personal-brand/api-client": "workspace:*",
"@tanstack/react-query": "^5.103.1",
"antd": "^6.6.4",
+15
View File
@@ -0,0 +1,15 @@
import { createElement, type ReactNode } from "react";
import { Navigate, Route, Routes } from "react-router-dom";
export function AdminOverviewRedirect() {
return createElement(Navigate, { to: "/admin/overview", replace: true });
}
export function AdminRouter({ children }: { children: ReactNode }) {
return createElement(
Routes,
null,
createElement(Route, { path: "/admin/*", element: children }),
createElement(Route, { path: "*", element: createElement(AdminOverviewRedirect) }),
);
}
+188
View File
@@ -0,0 +1,188 @@
import { useQuery } from "@tanstack/react-query";
import {
AppstoreOutlined,
BarsOutlined,
CloudUploadOutlined,
FormOutlined,
LayoutOutlined,
MessageOutlined,
MobileOutlined,
SafetyCertificateOutlined,
ShopOutlined,
TeamOutlined,
ThunderboltOutlined,
} from "@ant-design/icons";
import { useLocation, useNavigate } from "react-router-dom";
import { createApiClient } from "../lib/api.js";
import { BrandMark } from "../components/BrandMark.js";
import { StatusTag } from "../components/StatusTag.js";
import {
FeatureBrandPage,
FeatureBrandsPage,
FeatureCapabilitiesPage,
FeatureCreateBrandPage,
FeatureInquiriesPage,
FeatureMembersPage,
FeatureOverviewPage,
FeaturePageSchemePage,
FeaturePublicationPage,
FeatureTemplateManagementPage,
FeatureServicesPage,
FeatureTrustContentPage,
FeatureWorkspacePage,
} from "./routes.js";
import { LoadingStack } from "../components/LoadingStack.js";
import { AdminMenu } from "../components/AdminMenu.js";
import { App } from "antd";
import { AdminButton } from "../components/AdminButton.js";
import { AdminSelect } from "../components/AdminSelect.js";
import { AdminLayout } from "../components/AdminLayout.js";
import { Route, Routes } from "react-router-dom";
import { AdminOverviewRedirect } from "./AdminRouter.js";
import { createBrandRouteElement } from "./route-access.js";
import { Suspense } from "react";
import { AdminErrorBoundary } from "../components/AdminErrorBoundary.js";
import { toBrandDisplayName, toBrandSwitcherOptions } from "../lib/brand-switcher.js";
export function Dashboard({
onLogout,
role,
platformTemplateRole,
}: {
onLogout: () => void;
role: string;
platformTemplateRole: "none" | "template_admin";
}) {
const { message } = App.useApp();
const navigate = useNavigate();
const location = useLocation();
const brand = useQuery({
queryKey: ["admin-shell-brand"],
queryFn: () => createApiClient().getAdminBrand(),
});
const memberships = useQuery({
queryKey: ["admin-brand-memberships"],
queryFn: () => createApiClient().listAdminBrands(),
});
const switchBrand = async (brandId: string) => {
try {
await createApiClient().switchAdminBrand(brandId);
window.location.reload();
} catch (error) {
message.error(error instanceof Error ? error.message : "品牌切换失败");
}
};
const page = location.pathname.split("/")[2] || "overview";
const brandName = toBrandDisplayName(brand.data?.name, "当前品牌");
const brandOptions = toBrandSwitcherOptions(memberships.data);
const items = [
{
type: "group" as const,
label: "日常经营",
children: [
{ key: "overview", label: "当前品牌概览", icon: <AppstoreOutlined /> },
{ key: "publication", label: "内容与发布", icon: <CloudUploadOutlined /> },
{ key: "brand", label: "小程序页面", icon: <MobileOutlined /> },
{ key: "trust", label: "信任内容", icon: <SafetyCertificateOutlined /> },
{ key: "services", label: "业务提供项", icon: <BarsOutlined /> },
{ key: "inquiries", label: "咨询记录", icon: <MessageOutlined /> },
{ key: "workspace", label: "咨询表单与字段", icon: <FormOutlined /> },
],
},
...(role === "editor"
? []
: [
{
type: "group" as const,
label: "品牌设置",
children: [
{ key: "brands", label: "品牌管理", icon: <ShopOutlined /> },
{ key: "page-scheme", label: "页面方案", icon: <LayoutOutlined /> },
{ key: "capabilities", label: "能力插件", icon: <ThunderboltOutlined /> },
{ key: "members", label: "团队成员", icon: <TeamOutlined /> },
...(platformTemplateRole === "template_admin"
? [{ key: "templates", label: "模板管理", icon: <AppstoreOutlined /> }]
: []),
],
},
]),
];
return (
<AdminLayout className="admin-shell">
<AdminLayout.Sider className="admin-sider" breakpoint="lg" collapsedWidth={0} width={232}>
<div className="admin-sider-brand">
<BrandMark name={toBrandDisplayName(brand.data?.name, "")} />
<span className="admin-sider-brand-name">品牌工作区</span>
</div>
<AdminMenu
selectedKeys={[page]}
onClick={({ key }) => navigate(`/admin/${key}`)}
items={items}
/>
</AdminLayout.Sider>
<AdminLayout className="admin-main">
<AdminLayout.Header className="admin-header">
<div className="admin-header-left">
<span className="admin-header-brand">{brandName}</span>
<span className="admin-header-context">品牌工作区</span>
<StatusTag
tone={role === "owner" ? "info" : "neutral"}
label={role === "owner" ? "负责人" : "内容编辑"}
/>
<AdminSelect
size="small"
variant="outlined"
className="admin-brand-switcher"
value={brand.data?.id}
loading={memberships.isLoading}
onChange={(value: string | undefined) => {
if (value) void switchBrand(value);
}}
options={brandOptions}
/>
</div>
<AdminButton type="text" onClick={onLogout}>
退出登录
</AdminButton>
</AdminLayout.Header>
<AdminLayout.Content className="admin-content">
<div className="admin-content-inner">
<AdminErrorBoundary key={location.pathname}>
<Suspense fallback={<LoadingStack />}>
<Routes>
<Route index element={<AdminOverviewRedirect />} />
<Route path="overview" element={<FeatureOverviewPage />} />
<Route path="publication" element={<FeaturePublicationPage />} />
<Route path="brand" element={<FeatureBrandPage />} />
<Route path="trust" element={<FeatureTrustContentPage />} />
<Route path="services" element={<FeatureServicesPage />} />
<Route path="inquiries" element={<FeatureInquiriesPage />} />
<Route path="workspace" element={<FeatureWorkspacePage />} />
{role === "editor" ? null : (
<>
<Route
path="brands"
element={<FeatureBrandsPage canCreate={role === "owner"} />}
/>
<Route
path="brands/new"
element={createBrandRouteElement(role, <FeatureCreateBrandPage />)}
/>
<Route path="page-scheme" element={<FeaturePageSchemePage />} />
<Route path="capabilities" element={<FeatureCapabilitiesPage />} />
<Route path="members" element={<FeatureMembersPage />} />
{platformTemplateRole === "template_admin" ? (
<Route path="templates" element={<FeatureTemplateManagementPage />} />
) : null}
</>
)}
<Route path="*" element={<AdminOverviewRedirect />} />
</Routes>
</Suspense>
</AdminErrorBoundary>
</div>
</AdminLayout.Content>
</AdminLayout>
</AdminLayout>
);
}
+87
View File
@@ -0,0 +1,87 @@
import React, { useState } from "react";
import type { AdminSession } from "@personal-brand/api-client";
import { ChangePassword, Login } from "../features/auth/AuthPages.js";
import { Dashboard } from "./Dashboard.js";
import { AdminRouter } from "./AdminRouter.js";
import { App } from "antd";
import { createApiClient } from "../lib/api.js";
import { LoadingStack } from "../components/LoadingStack.js";
import { AdminErrorBoundary } from "../components/AdminErrorBoundary.js";
type SessionState = Omit<AdminSession, "authenticated">;
export function Root() {
const { message } = App.useApp();
const [session, setSession] = useState<SessionState | null>(null);
const [loading, setLoading] = useState(true);
React.useEffect(() => {
let active = true;
createApiClient()
.getAdminSession()
.then((current) => {
if (active) setSession(current);
})
.catch(() => {
if (active) setSession(null);
})
.finally(() => {
if (active) setLoading(false);
});
return () => {
active = false;
};
}, []);
React.useEffect(() => {
const expire = () => {
message.warning("登录状态已失效,请重新登录");
setSession(null);
};
window.addEventListener("admin-auth-expired", expire);
return () => window.removeEventListener("admin-auth-expired", expire);
}, []);
const logout = async () => {
try {
await createApiClient().logoutAdmin();
} catch {
message.warning("已退出本地会话;服务端撤销请求未完成");
} finally {
setSession(null);
}
};
if (loading) return <LoadingStack />;
if (!session)
return (
<Login
onLogin={(current) => {
setSession(current);
}}
/>
);
if (session.mustChangePassword)
return (
<ChangePassword
onComplete={async () => {
try {
setSession(await createApiClient().getAdminSession());
} catch {
setSession(null);
}
}}
/>
);
return (
<AdminErrorBoundary variant="page">
<AdminRouter>
<Dashboard
onLogout={logout}
role={session.role}
platformTemplateRole={session.platformTemplateRole}
/>
</AdminRouter>
</AdminErrorBoundary>
);
}
+14
View File
@@ -0,0 +1,14 @@
import { createElement, type ReactNode } from "react";
import { Navigate } from "react-router-dom";
export const createBrandFallbackPath = "/admin/brands";
export function canCreateBrand(role: string) {
return role === "owner";
}
export function createBrandRouteElement(role: string, content: ReactNode) {
return canCreateBrand(role)
? content
: createElement(Navigate, { to: createBrandFallbackPath, replace: true });
}
+65
View File
@@ -0,0 +1,65 @@
import React from "react";
export const FeatureInquiriesPage = React.lazy(() =>
import("../features/inquiries/InquiriesPage.js").then((module) => ({
default: module.InquiriesPage,
})),
);
export const FeatureTrustContentPage = React.lazy(() =>
import("../features/trust-content/TrustContentPage.js").then((module) => ({
default: module.TrustContentPage,
})),
);
export const FeatureServicesPage = React.lazy(() =>
import("../features/services/ServicesPage.js").then((module) => ({
default: module.ServicesPage,
})),
);
export const FeatureBrandPage = React.lazy(() =>
import("../features/brand/BrandPage.js").then((module) => ({ default: module.BrandPage })),
);
export const FeatureWorkspacePage = React.lazy(() =>
import("../features/workspace/WorkspacePage.js").then((module) => ({
default: module.WorkspacePage,
})),
);
export const FeatureOverviewPage = React.lazy(() =>
import("../features/overview/OverviewPage.js").then((module) => ({
default: module.OverviewPage,
})),
);
export const FeatureCapabilitiesPage = React.lazy(() =>
import("../features/capabilities/CapabilitiesPage.js").then((module) => ({
default: module.CapabilitiesPage,
})),
);
export const FeatureMembersPage = React.lazy(() =>
import("../features/team/MembersPage.js").then((module) => ({
default: module.MembersPage,
})),
);
export const FeaturePublicationPage = React.lazy(() =>
import("../features/publication/PublicationPage.js").then((module) => ({
default: module.PublicationPage,
})),
);
export const FeatureTemplateManagementPage = React.lazy(() =>
import("../features/template-management/TemplateManagementPage.js").then((module) => ({
default: module.TemplateManagementPage,
})),
);
export const FeatureBrandsPage = React.lazy(() =>
import("../features/brands/BrandsPage.js").then((module) => ({
default: module.BrandsPage,
})),
);
export const FeatureCreateBrandPage = React.lazy(() =>
import("../features/brands/CreateBrandPage.js").then((module) => ({
default: module.CreateBrandPage,
})),
);
export const FeaturePageSchemePage = React.lazy(() =>
import("../features/page-scheme/PageSchemePage.js").then((module) => ({
default: module.PageSchemePage,
})),
);
@@ -0,0 +1,6 @@
import { Button } from "antd";
import type { ButtonProps } from "antd";
export function AdminButton(props: ButtonProps) {
return <Button {...props} />;
}
+6
View File
@@ -0,0 +1,6 @@
import { Card } from "antd";
import type { CardProps } from "antd";
export function AdminCard(props: CardProps) {
return <Card {...props} />;
}
@@ -0,0 +1,14 @@
import { App, ConfigProvider } from "antd";
import type { ConfigProviderProps } from "antd";
import type { ReactNode } from "react";
export function AdminConfigProvider({
children,
...props
}: ConfigProviderProps & { children?: ReactNode }) {
return (
<ConfigProvider {...props}>
<App>{children}</App>
</ConfigProvider>
);
}
@@ -0,0 +1,98 @@
import { Component, type ErrorInfo, type ReactNode } from "react";
import { Button, Result, Space, Typography } from "antd";
import { createApiClient } from "../lib/api.js";
interface AdminErrorBoundaryProps {
children: ReactNode;
variant?: "page" | "content";
}
interface AdminErrorBoundaryState {
error: Error | null;
errorId: string | null;
}
function createErrorId(): string {
return `admin-${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 8)}`;
}
/**
* 后台渲染错误边界:页面级兜底整页,内容级兜底单个业务页面且保留导航。
* React 只支持 class 组件捕获渲染异常,因此这里保留 class 实现。
*/
export class AdminErrorBoundary extends Component<
AdminErrorBoundaryProps,
AdminErrorBoundaryState
> {
override state: AdminErrorBoundaryState = { error: null, errorId: null };
private reportedErrorId: string | null = null;
static getDerivedStateFromError(error: Error): AdminErrorBoundaryState {
return { error, errorId: createErrorId() };
}
override componentDidCatch(error: Error, info: ErrorInfo) {
const errorId = this.state.errorId ?? createErrorId();
console.error("[admin] 页面渲染异常", errorId, error, info.componentStack);
if (this.reportedErrorId === errorId) return;
this.reportedErrorId = errorId;
// 上报失败不能影响错误页本身:只记录到控制台,不抛出、不改状态。
void createApiClient()
.reportAdminClientError({
errorId,
message: error.message.slice(0, 2000) || error.name,
route: `${window.location.pathname}${window.location.search}`.slice(0, 500),
...(info.componentStack ? { componentStack: info.componentStack.slice(0, 20000) } : {}),
})
.catch((reportError: unknown) => {
console.warn("[admin] 渲染异常上报失败", errorId, reportError);
});
}
private reset = () => {
this.setState({ error: null, errorId: null });
};
private reload = () => {
window.location.reload();
};
override render() {
const { error, errorId } = this.state;
if (!error) return this.props.children;
const isPage = this.props.variant === "page";
return (
<Result
status="error"
title="页面渲染出错"
subTitle={
isPage
? "后台页面无法显示。可以重新加载;如果问题持续,请把错误编号提供给管理员。"
: "这个页面无法显示,其他页面仍可正常使用。可以重试或重新加载页面。"
}
extra={
<Space wrap>
{isPage ? null : (
<Button type="primary" onClick={this.reset}>
重试
</Button>
)}
<Button type={isPage ? "primary" : "default"} onClick={this.reload}>
重新加载页面
</Button>
{isPage ? <Button href="/admin/overview">返回概览</Button> : null}
</Space>
}
>
<Typography.Paragraph type="secondary" copyable={{ text: errorId ?? "" }}>
错误编号:{errorId}
</Typography.Paragraph>
{import.meta.env.DEV ? (
<Typography.Paragraph type="secondary">
开发环境错误信息:{error.message}
</Typography.Paragraph>
) : null}
</Result>
);
}
}
+1
View File
@@ -0,0 +1 @@
export { Form as AdminForm, Input as AdminInput } from "antd";
+12
View File
@@ -0,0 +1,12 @@
import { Layout } from "antd";
import type { BasicProps } from "antd/es/layout/layout";
function AdminLayoutBase(props: BasicProps) {
return <Layout {...props} />;
}
export const AdminLayout = Object.assign(AdminLayoutBase, {
Sider: Layout.Sider,
Header: Layout.Header,
Content: Layout.Content,
});
+6
View File
@@ -0,0 +1,6 @@
import { Menu } from "antd";
import type { MenuProps } from "antd";
export function AdminMenu(props: MenuProps) {
return <Menu {...props} />;
}
+5 -15
View File
@@ -1,4 +1,3 @@
import { Space, Typography } from "antd";
import type { ReactNode } from "react";
export function AdminPageHeader({
@@ -11,21 +10,12 @@ export function AdminPageHeader({
extra?: ReactNode;
}) {
return (
<Space
align="start"
style={{ width: "100%", justifyContent: "space-between", marginBottom: 24 }}
>
<div>
<Typography.Title level={2} style={{ margin: 0 }}>
{title}
</Typography.Title>
{description && (
<Typography.Paragraph type="secondary" style={{ margin: "8px 0 0" }}>
{description}
</Typography.Paragraph>
)}
<header className="admin-page-header">
<div className="admin-page-header-text">
<h1 className="admin-page-header-title">{title}</h1>
{description ? <p className="admin-page-header-description">{description}</p> : null}
</div>
{extra}
</Space>
</header>
);
}
@@ -0,0 +1,28 @@
import type { ReactNode } from "react";
export function AdminSection({
title,
description,
extra,
children,
}: {
title?: ReactNode;
description?: ReactNode;
extra?: ReactNode;
children: ReactNode;
}) {
return (
<section className="admin-section">
{title ? (
<div className="admin-section-head">
<div>
<h2 className="admin-section-title">{title}</h2>
{description ? <p className="admin-section-description">{description}</p> : null}
</div>
{extra}
</div>
) : null}
{children}
</section>
);
}
@@ -0,0 +1,6 @@
import { Select } from "antd";
import type { SelectProps } from "antd";
export function AdminSelect(props: SelectProps) {
return <Select {...props} />;
}
@@ -0,0 +1,6 @@
import { Skeleton } from "antd";
import type { SkeletonProps } from "antd";
export function AdminSkeleton(props: SkeletonProps) {
return <Skeleton {...props} />;
}
+17
View File
@@ -0,0 +1,17 @@
/**
* 品牌标识:取品牌名首字渲染单字标记,未取到品牌时回落到中性字。
* 视觉规则见 apps/admin/design.md 的「侧栏导航」。
*/
export function BrandMark({
name,
fallback = "品",
className = "admin-sider-brand-mark",
}: {
name?: string | null | undefined;
fallback?: string;
className?: string;
}) {
const trimmed = name?.trim() ?? "";
const mark = Array.from(trimmed)[0] ?? fallback;
return <span className={className}>{mark}</span>;
}
Loaded 100 of 605 files, more files were not shown because too many files have changed in this diff. Show more