liuyun d2c75bd04c chore(openspec): sync foundation specs to main, archive init-shared-foundation
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-10-10 21:17:45 +08:00

45 lines
1.9 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

## 1. 后端工程地基
- [x] 1.1 在 sysmgr-nest 接入 Prisma + MySQL,配置 PrismaService 与连接
- [x] 1.2 配置全局响应封装拦截器(`{code, message, data}`)
- [x] 1.3 配置全局异常过滤器(错误码分段 400xx/401xx/403xx/404xx/409xx/500xx)
## 2. 数据模型落地
- [x] 2.1 编写 Prisma schema:tenant / user / role / resource / org / dict_type / dict_item / config
- [x] 2.2 编写 Prisma schema:audit_log / login_log / refresh_token / user_role / role_resource / role_org
- [x] 2.3 生成并执行首版 migration
- [x] 2.4 定义 TS 应用层枚举(status / resource type / data_scope 等)
## 3. 认证与鉴权
- [x] 3.1 实现密码哈希工具(argon2/bcrypt)
- [x] 3.2 实现登录接口(tenantCode + username + password → access + refresh)
- [x] 3.3 实现刷新接口(refresh 旋转,作废旧 token)
- [x] 3.4 实现登出 / 踢人(置 revoked_at)
- [x] 3.5 实现 JWT access 签发与校验守卫
- [x] 3.6 实现 @RequirePermissions 装饰器与权限守卫(三级鉴权)
## 4. 横切过滤器
- [x] 4.1 实现多租户 tenant_id 过滤(Prisma 扩展 client 统一注入)
- [x] 4.2 实现软删 deleted_at 过滤
- [x] 4.3 实现数据权限 data_scope 可见部门计算与 org_id 过滤
## 5. 核心域 CRUD
- [x] 5.1 租户管理 CRUD
- [x] 5.2 用户管理 CRUD(含密码重置、启停/锁定)
- [x] 5.3 角色管理 CRUD(含资源分配、data_scope)
- [x] 5.4 资源管理 CRUD(树形,menu/button/api)
- [x] 5.5 组织管理 CRUD(树形)
- [x] 5.6 字典管理 CRUD(类型 + 项)
- [x] 5.7 参数配置 CRUD
- [x] 5.8 操作日志 / 登录日志查询接口
## 6. 前端地基
- [x] 6.1 封装 API client(`{code,message,data}` 统一处理、token 注入、401 自动刷新)
- [x] 6.2 登录页 + 路由守卫(未登录跳转)
- [x] 6.3 对接认证接口(login / refresh / logout)