9 Commits

Author SHA1 Message Date
liuyun
86832ce32d feat(session): 在线会话强踢 + 账号锁定/解锁
- JWT 引入 sid,单会话精确强退(sid 黑名单)与按用户踢全部(tokenVersion)
- User 新增 lockedAt/lockReason,登录/刷新/守卫统一拒绝锁定
- sessions 模块:活跃会话列表 + 单会话强退;users 新增 lock/unlock/kick-sessions
- 资源注册 + syncTenantResources 存量租户补齐脚本

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-10-11 21:35:43 +08:00
liuyun
ebc0797424 chore: 移除 @nestjs/mau + deploy 脚本;补 package 元数据与 MIT 许可
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-10-11 16:57:46 +08:00
liuyun
ba1ae43e39 feat(security): helmet + CORS 白名单 + 限流 + 定时清理 + 时间契约 Unix 毫秒
- helmet 安全头 + CORS_ORIGIN 白名单 + Swagger 仅非生产
- @nestjs/throttler 全局限流(60s/100 次)
- @nestjs/schedule 定时清理过期 token 与旧日志
- API 时间统一 Unix 毫秒(TransformInterceptor 递归转换)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-10-11 16:54:08 +08:00
liuyun
7340658305 feat: enforce RBAC, audit/login logging, and seed script
收口 Phase 0 三处「声明未生效」:
- 三级鉴权落地:权限集存 Redis(key 前缀隔离多项目),@RequirePermissions 挂到全部受控接口,super_admin 角色绕过权限码与 data_scope
- 审计/登录日志自动落库:@AuditLog 装饰器 + 拦截器异步写入(写操作+登录登出),登录成功/失败均记 login_log(脱敏)
- seed 脚本:一键初始化租户 touyun/用户 touyun/超管 super_admin/全量资源树(48 资源全量授权)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-10-10 23:19:41 +08:00
liuyun
f6fddb4a53 feat: use pino-pretty for readable dev logs (LOG_PRETTY, default true)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-10-10 21:49:34 +08:00
liuyun
24790e8985 feat: add Swagger API docs (/docs) with DTO schemas
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-10-10 21:39:37 +08:00
liuyun
bbc06ae775 feat: add pino structured logging (stdout + optional file via env)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-10-10 21:31:05 +08:00
liuyun
d8d3055c73 feat: backend foundation (Prisma 6 + MySQL, auth, tenant/soft-delete/data-scope filters, core CRUD)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-10-10 21:13:35 +08:00
liuyun
dc40ca3343 chore: init sysmgr-nest (NestJS scaffold)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-10-10 14:03:17 +08:00