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