feat(rvw): complete journal config center MVP and tenant login routing

Deliver the RVW V4.0 journal configuration center across backend, frontend, migration, and docs with zh/en editorial baseline support and tenant-level prompt/template overrides. Unify tenant login to /:tenantCode/login and auto-enable RVW module when tenant type is JOURNAL to prevent post-login access gaps.

Made-with: Cursor
This commit is contained in:
2026-03-15 11:51:35 +08:00
parent 16179e16ca
commit 83e395824b
44 changed files with 2555 additions and 312 deletions

View File

@@ -14,7 +14,7 @@ import { LockOutlined } from '@ant-design/icons'
* 3. 有权限→渲染子组件
*
* @version 2026-03-14 V4.0:租户感知重定向
* - 期刊租户路径(/jtim/*)→ /t/jtim/login?redirect=/jtim/dashboard
* - 期刊租户路径(/jtim/*)→ /jtim/login?redirect=/jtim/dashboard
* - 主平台路径(/rvw/*, /ai-qa/* 等)→ /login行为不变
* - extractTenantSlug 由 useTenantObserver 模块统一维护,自动排除所有注册模块路径
*/
@@ -22,16 +22,16 @@ import { LockOutlined } from '@ant-design/icons'
/**
* 构造未登录时的登录跳转目标。
*
* 对齐 App.tsx 中已定义的路由:<Route path="/t/:tenantCode/login" />
* 对齐 App.tsx 中已定义的路由:<Route path="/:tenantCode/login" />
*
* - 期刊租户下:/t/jtim/login?redirect=%2Fjtim%2Fdashboard
* - 期刊租户下:/jtim/login?redirect=%2Fjtim%2Fdashboard
* - 主站下:/login保持原有行为向后兼容
*/
function buildLoginRedirect(pathname: string): string {
const tenantSlug = extractTenantSlug(pathname)
if (!tenantSlug) return '/login'
const redirectParam = encodeURIComponent(pathname)
return `/t/${tenantSlug}/login?redirect=${redirectParam}`
return `/${tenantSlug}/login?redirect=${redirectParam}`
}
interface RouteGuardProps {