zhou zhou
12 小时以前 40905cbd04c2e332cd4bc2b9e0c5b3e1da9cccfa
rsf-design/src/utils/navigation/route.js
@@ -1,6 +1,11 @@
import { PHASE_1_COMPONENTS } from '../../router/adapters/backendMenuAdapter.js'
const RELEASED_COMPONENT_PATHS = new Set(Object.values(PHASE_1_COMPONENTS))
function isIframe(url) {
  return url.startsWith('/outside/iframe/')
}
const isNavigableMenuItem = (menuItem) => {
  if (!menuItem.path || !menuItem.path.trim()) {
    return false
@@ -13,6 +18,15 @@
const normalizePath = (path) => {
  return path.startsWith('/') ? path : `/${path}`
}
const hasReleasedComponent = (menuItem) => {
  if (!menuItem || typeof menuItem !== 'object') {
    return false
  }
  const componentPath = typeof menuItem.component === 'string' ? menuItem.component.trim() : ''
  return RELEASED_COMPONENT_PATHS.has(componentPath)
}
const getFirstMenuPath = (menuList) => {
  if (!Array.isArray(menuList) || menuList.length === 0) {
    return ''
@@ -27,7 +41,9 @@
        return childPath
      }
    }
    return normalizePath(menuItem.path)
    if (hasReleasedComponent(menuItem)) {
      return normalizePath(menuItem.path)
    }
  }
  return ''
}