Commit Graph

2 Commits

Author SHA1 Message Date
263a7c4616 feat(iter-v2): T01 complete - security + infrastructure
- S1: .githooks/pre-commit blocks .env commits, .env.test in .gitignore
- S3: TOKEN_SECRET centralized to config/token.ts, all files import from it
- S3: checkTokenSecret enforces min 32-char TOKEN_SECRET at startup
- S5: Refresh Token mechanism (Access 2h + Refresh 30d, dual token)
- S5: POST /auth/refresh endpoint with rotation and max 5 per user
- S5: Frontend request.ts auto-refresh on 40101, concurrent-safe
- S6: Soft delete (deleted_at column), admin soft-delete with confirmName
- S6: POST /admin/users/:id/restore endpoint
- S6: All user queries filter deleted_at IS NULL
- S7: DB connection requires env vars, no fallback credentials
- Infra: jest.config.js, vitest.config.ts, .env.test
- Infra: node-cron, jest, ts-jest, supertest, vitest, @pinia/testing
2026-06-11 09:24:10 +08:00
9ef960321f fix: 启动时自动迁移缺失的数据库列
问题:旧版数据库缺少 user_id 列导致 500 错误
修复:
- init.ts 启动时自动检测并添加缺失列
- 删除 deploy/ 目录,改为手动部署
- 添加 migrate.sql 迁移脚本
- 更新 CLAUDE.md 部署说明
2026-05-29 16:46:39 +08:00