chore: check off Task 6 (AppModule registration)
This commit is contained in:
@@ -1324,7 +1324,7 @@ git commit -m "feat(rbac): add RbacController with role CRUD, permissions tree,
|
||||
**Interfaces:**
|
||||
- Produces: PermissionGuard 作为 APP_GUARD 全局生效;RbacModule 初始化种子数据
|
||||
|
||||
- [ ] **Step 1: 修改 AppModule**
|
||||
- [x] **Step 1: 修改 AppModule**
|
||||
|
||||
在 `backend/src/app.module.ts` 中:
|
||||
|
||||
@@ -1419,7 +1419,7 @@ import { PermissionGuard } from './auth/guards/permission.guard';
|
||||
export class AppModule {}
|
||||
```
|
||||
|
||||
- [ ] **Step 2: 启动验证**
|
||||
- [x] **Step 2: 启动验证**
|
||||
|
||||
```bash
|
||||
cd backend && npm run start:dev
|
||||
@@ -1430,7 +1430,7 @@ cd backend && npm run start:dev
|
||||
- 无崩溃无错误
|
||||
- 尝试不带 token 访问任意接口 → 返回 403
|
||||
|
||||
- [ ] **Step 3: Commit**
|
||||
- [x] **Step 3: Commit**
|
||||
|
||||
```bash
|
||||
git add backend/src/app.module.ts
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
- [x] 3.2 创建 PermissionGuard:从 JWT payload 中读取 permissions 数组,与装饰器标注的权限做匹配
|
||||
- [x] 3.3 修改 JwtStrategy 和 AuthService.login:登录时调用 getUserPermissions,将 permissions 写入 JWT payload
|
||||
- [x] 3.4 修改 AuthService.validateUser/profile:返回用户信息时携带角色和权限列表
|
||||
- [ ] 3.5 全局注册 PermissionGuard(或在各模块按需注册)
|
||||
- [x] 3.5 全局注册 PermissionGuard(或在各模块按需注册)
|
||||
|
||||
## 4. 现有接口批量加守卫
|
||||
|
||||
|
||||
Reference in New Issue
Block a user