feat(web): 增加单点登录分流与本地应急入口

开启统一认证后,正常登录入口直接跳转认证中心,并将本地账号入口收敛到 /login 应急页;未开启统一认证时继续保留工作台内原有登录方式。

影响范围仅限 Web 登录路由、认证入口展示和相关测试,不修改认证接口或 OpenAPI。风险主要在运行时身份状态判断,已通过 141 项前端测试、生产构建、无缓存类型检查及浏览器分支验证。
This commit is contained in:
2026-07-31 13:43:06 +08:00
parent cae97b6f77
commit 88c971564a
10 changed files with 169 additions and 14 deletions
+2
View File
@@ -87,6 +87,7 @@ export function parseAppRoute(input = currentLocationPath()): AppRouteState {
const workspaceTaskQuery = parseWorkspaceTaskQuery(url.searchParams);
const adminTaskQuery = parseAdminTaskQuery(url.searchParams);
if (path === '/') return { ...defaultRouteState };
if (path === '/login') return { ...defaultRouteState, activePage: 'login', workspaceTaskQuery, adminTaskQuery };
if (path.startsWith('/playground')) {
return { ...defaultRouteState, activePage: 'playground', playgroundMode: parsePlaygroundMode(path), workspaceTaskQuery, adminTaskQuery };
}
@@ -114,6 +115,7 @@ export function pathForPage(page: PageKey, route: AppRouteState): string {
if (page === 'workspace') return pathForWorkspaceSection(route.workspaceSection);
if (page === 'admin') return pathForAdminSection(route.adminSection);
if (page === 'docs') return pathForApiDocSection(route.apiDocSection);
if (page === 'login') return '/login';
return '/';
}