diff --git a/web/apps/web-ele/src/router/access.ts b/web/apps/web-ele/src/router/access.ts index d41bb64..f5be129 100644 --- a/web/apps/web-ele/src/router/access.ts +++ b/web/apps/web-ele/src/router/access.ts @@ -15,14 +15,25 @@ import { isLightMenuName } from './light-menu'; const forbiddenComponent = () => import('#/views/_core/fallback/forbidden.vue'); +const LEGACY_COMPONENT_MAP: Record = { + '/online-dev/page-render/index': '/_core/page-render/index', + 'online-dev/page-render/index': '/_core/page-render/index', +}; + function normalizeViewPath(path: string) { - const normalizedPath = path.replace(/^(\.\/|\.\.\/)+/, ''); + const mappedPath = LEGACY_COMPONENT_MAP[path] || path; + const normalizedPath = mappedPath.replace(/^(\.\/|\.\.\/)+/, ''); const viewPath = normalizedPath.startsWith('/') ? normalizedPath : `/${normalizedPath}`; return viewPath.replace(/^\/views/, ''); } +function normalizeRouteComponent(component?: string) { + if (!component) return component; + return LEGACY_COMPONENT_MAP[component] || component; +} + function hasPageComponent( component: string | undefined, pageMap: ComponentRecordType, @@ -156,7 +167,9 @@ function filterAvailableRoutes< return groupRoute; } - if (!hasPageComponent(route.component, pageMap, layoutMap)) { + const component = normalizeRouteComponent(route.component); + + if (!hasPageComponent(component, pageMap, layoutMap)) { if (!children?.length) return undefined; const groupRoute = { ...route, children }; @@ -164,7 +177,12 @@ function filterAvailableRoutes< return groupRoute; } - return children ? { ...route, children } : route; + const nextRoute = + component && component !== route.component + ? { ...route, component } + : route; + + return children ? { ...nextRoute, children } : nextRoute; }) .filter(Boolean) as T[]; } diff --git a/web/apps/web-ele/src/router/light-menu.ts b/web/apps/web-ele/src/router/light-menu.ts index b89b491..6a9949b 100644 --- a/web/apps/web-ele/src/router/light-menu.ts +++ b/web/apps/web-ele/src/router/light-menu.ts @@ -14,6 +14,8 @@ export const LIGHT_MENU_NAMES = new Set([ 'AnnouncementList', 'AnnouncementManage', 'CodexAgentChat', + 'ControlCenter', + 'ControlCenterLegacyRedirect', 'Message', 'MessageCenter', 'MessageList', @@ -44,6 +46,7 @@ const LIGHT_ROUTE_PATH_PREFIXES = [ '/ai-platform/workflow', '/ai-platform/workflow-runs', '/agent-chat', + '/control-center', '/message/list', '/message/announcement', '/message/announcement-list',