feat(admin): Complete tenant management and module access control system

Major Features:
- Tenant management CRUD (list, create, edit, delete, module configuration)
- Dynamic module management system (modules table with 8 modules)
- Multi-tenant module permission merging (ModuleService)
- Module access control middleware (requireModule)
- User module permission API (GET /api/v1/auth/me/modules)
- Frontend module permission filtering (HomePage + TopNavigation)

Module Integration:
- RVW module integrated with PromptService (editorial + methodology)
- All modules (RVW/PKB/ASL/DC) added authenticate + requireModule middleware
- Fixed ReviewTask foreign key constraint (cross-schema issue)
- Removed all MOCK_USER_ID, unified to request.user?.userId

Prompt Management Enhancements:
- Module names displayed in Chinese (RVW -> 智能审稿)
- Enhanced version history with view content and rollback features
- List page shows both activeVersion and draftVersion columns

Database Changes:
- Added platform_schema.modules table
- Modified tenant_modules table (added index and UUID)
- Removed ReviewTask foreign key to public.users (cross-schema fix)
- Seeded 8 modules: RVW, PKB, ASL, DC, IIT, AIA, SSA, ST

Documentation Updates:
- Updated ADMIN module development status
- Updated TODO checklist (89% progress)
- Updated Prompt management plan (Phase 3.5.5 completed)
- Added module authentication specification

Files Changed: 80+
Status: All features tested and verified locally
Next: User management module development
This commit is contained in:
2026-01-13 07:34:30 +08:00
parent 5523ef36ea
commit d595037316
51 changed files with 3550 additions and 287 deletions

View File

@@ -1,17 +1,17 @@
# ADMIN-运营管理端 - 开发TODO清单
> **版本:** v1.2
> **版本:** v1.3
> **创建日期:** 2026-01-11
> **最后更新:** 2026-01-11
> **总进度:** 79/110 (72%)
> **状态:** 🚧 Phase 3.5.4 已完成,准备 Phase 3.5.5
> **最后更新:** 2026-01-12
> **总进度:** 98/110 (89%)
> **状态:** Phase 3.5.5 已完成Phase 4.0 租户管理已完成
---
## 📊 总体进度
```
█████░░░░░ 52%
████████░░ 89%
```
| Phase | 完成 | 总计 | 进度 | 状态 |
@@ -20,8 +20,8 @@
| Phase 1 | 15 | 15 | 100% | ✅ 已完成 |
| Phase 2 | 20 | 20 | 100% | ✅ 已完成 |
| Phase 3 | 12 | 12 | 100% | ✅ 已完成 |
| Phase 3.5 | 15 | 18 | 83% | 🚧 进行中 |
| Phase 4 | 0 | 25 | 0% | ⏳ 待开始 |
| Phase 3.5 | 18 | 18 | 100% | ✅ 已完成 2026-01-12 |
| Phase 4 | 19 | 25 | 76% | 🚧 租户管理已完成 2026-01-12 |
| Phase 5 | 0 | 10 | 0% | ⏳ 待开始 |
---