diff --git a/web/apps/web-ele/src/router/access.ts b/web/apps/web-ele/src/router/access.ts index 50b39d2..6324fbf 100644 --- a/web/apps/web-ele/src/router/access.ts +++ b/web/apps/web-ele/src/router/access.ts @@ -48,23 +48,6 @@ function normalizePageMap(pageMap: ComponentRecordType) { ) as ComponentRecordType; } -function normalizeBackendRoute< - T extends { - component?: string; - name?: string; - path?: string; - query?: unknown; - }, ->(route: T) { - if (route.name !== 'ControlCenter') return route; - - const normalized = { ...route }; - normalized.path = '/ai-platform/agent'; - normalized.component = 'ai-platform/agent/index'; - normalized.query = undefined; - return normalized; -} - function isLightMenuRoute(route: { name?: string }) { return isLightMenuName(route.name); } @@ -84,39 +67,38 @@ function filterAvailableRoutes< ): T[] { return routes .map((route) => { - const normalizedRoute = normalizeBackendRoute(route); - const children = normalizedRoute.children - ? filterAvailableRoutes(normalizedRoute.children, pageMap, layoutMap) + const children = route.children + ? filterAvailableRoutes(route.children, pageMap, layoutMap) : undefined; - const routeAllowed = isLightMenuRoute(normalizedRoute); + const routeAllowed = isLightMenuRoute(route); if (!routeAllowed && !children?.length) { return undefined; } if ( - !normalizedRoute.component && - normalizedRoute.children && + !route.component && + route.children && !children?.length ) { return undefined; } if (!routeAllowed && children?.length) { - const groupRoute = { ...normalizedRoute, children }; + const groupRoute = { ...route, children }; delete groupRoute.component; return groupRoute; } - if (!hasPageComponent(normalizedRoute.component, pageMap, layoutMap)) { + if (!hasPageComponent(route.component, pageMap, layoutMap)) { if (!children?.length) return undefined; - const groupRoute = { ...normalizedRoute, children }; + const groupRoute = { ...route, children }; delete groupRoute.component; return groupRoute; } - return children ? { ...normalizedRoute, children } : normalizedRoute; + return children ? { ...route, children } : route; }) .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 71ebb75..b614692 100644 --- a/web/apps/web-ele/src/router/light-menu.ts +++ b/web/apps/web-ele/src/router/light-menu.ts @@ -7,7 +7,6 @@ export const LIGHT_MENU_NAMES = new Set([ 'AIWorkflowRuns', 'AnnouncementList', 'AnnouncementManage', - 'ControlCenter', 'KnowledgeBase', 'SystemManagement', 'SystemMenu',