fix: refine auth cookie and route redirects

This commit is contained in:
chengkml
2026-05-17 00:09:33 +08:00
parent 5cf82f3468
commit 4074f597c4
5 changed files with 76 additions and 23 deletions
+30
View File
@@ -0,0 +1,30 @@
## Work Log - graphify 构建 api/app 后端知识图谱(2026-05-12
- 背景:
-`./api/app` 执行 `$graphify`,目标是生成后端结构图谱,辅助后续代码导航与跨模块关系追踪。
- 仓库根目录检测结果超过 graphify 建议阈值,因此改为对子目录 `api/app` 单独建图。
- 语料与执行结果:
- `api/app` 检测为纯代码语料:`110` 个代码文件,约 `60,168` 词。
- 按 graphify 规则跳过 semantic extraction,仅执行 AST 抽取、聚类、报告与 HTML 可视化。
- 产物位于仓库根目录 `graphify-out/`
- `graph.html`
- `GRAPH_REPORT.md`
- `graph.json`
- `cost.json`
- `manifest.json`
- 关键指标:
- 图规模:`1174` nodes / `3445` edges / `35` communities。
- Token benchmark
- 语料约 `80,224` naive tokens
- 平均查询成本约 `12,893` tokens
-`6.2x` token reduction per query
- 关注点:
- 主要桥接节点包括 `utcnow()``publish_topic()``Base``UserPublic``normalize_virtual_path()`
- 低内聚社区主要集中在 `Elevation Workflow``Lightning Analysis`,适合后续做依赖与职责拆分审视。
- 风险与影响:
- 本次未改业务代码,仅新增图谱输出与当天记忆文件。
- `graphify-out/``api/app/graphify-out/cache/ast/` 为新生成工件,提交前应按需要决定是否纳入版本管理。
+21
View File
@@ -128,3 +128,24 @@
- 风险与关注点:
- 当前别名映射基于已知历史菜单路径补齐;若库里还存在其他非常规旧 path,仍需按实际反馈继续补别名表。
## Work Log - 生产入口 `/fl/login` 404 排查与 host Nginx 修复(2026-05-16
- 背景:
- 线上 `https://www.quizck.cn/fl/login` 一度返回 404,但仓库内 `web` 容器与本地代理均已包含 `/login` 页面。
- 进一步比对发现,问题出在宿主机 Nginx 的 `/fl` 精确匹配:`location = /fl { return 301 /fl/; }` 会把入口导向 `/fl/`,而 Next 在 `/fl/` 上又会归一回 `/fl`,形成不必要的重定向回环/错路由链。
- 本次修复:
- `/etc/nginx/conf.d/quiz.conf`
-`location = /fl` 的重定向目标改为 `/fl/login`
- 保留 `location ^~ /fl/` 继续反代到 `127.0.0.1:3000`
- 执行 `nginx -t && nginx -s reload` 让配置立即生效。
- 验证:
- `curl -I https://www.quizck.cn/fl/login` 返回 `200 OK`
- `curl -IL https://www.quizck.cn/fl` 返回 `301 -> /fl/login -> 200`
- `curl -IL https://www.quizck.cn/fl/` 返回 `308 -> /fl -> /fl/login -> 200`
- 风险与关注点:
- `/fl/` 仍会多一次跳转,但不再出现 404。
- 后续若统一外部入口,优先直接使用 `/fl/login`,避免再依赖 `/fl` 的归一逻辑。