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

@@ -14,6 +14,8 @@ import AdminDashboard from './pages/admin/AdminDashboard'
import OrgDashboard from './pages/org/OrgDashboard'
import PromptListPage from './pages/admin/PromptListPage'
import PromptEditorPage from './pages/admin/PromptEditorPage'
import TenantListPage from './pages/admin/tenants/TenantListPage'
import TenantDetailPage from './pages/admin/tenants/TenantDetailPage'
import { MODULES } from './framework/modules/moduleRegistry'
/**
@@ -89,8 +91,9 @@ function App() {
{/* Prompt 管理 */}
<Route path="prompts" element={<PromptListPage />} />
<Route path="prompts/:code" element={<PromptEditorPage />} />
{/* 其他模块(待开发) */}
<Route path="tenants" element={<div className="text-center py-20">🚧 ...</div>} />
{/* 租户管理 */}
<Route path="tenants" element={<TenantListPage />} />
<Route path="tenants/:id" element={<TenantDetailPage />} />
<Route path="users" element={<div className="text-center py-20">🚧 ...</div>} />
<Route path="system" element={<div className="text-center py-20">🚧 ...</div>} />
</Route>