zhou zhou
6 天以前 aaf8a50511d77dbc209ca93bbba308c21179a8bc
rsf-design/src/router/core/RouteValidator.js
@@ -1,4 +1,4 @@
import { RoutesAlias } from '../routesAlias'
import { RoutesAlias } from '../routesAlias.js'
class RouteValidator {
  constructor() {
    this.warnedRoutes = new Set()
@@ -23,11 +23,19 @@
   */
  checkDuplicates(routes, errors, warnings, parentPath = '') {
    const routeNameMap = /* @__PURE__ */ new Map()
    const routePathMap = /* @__PURE__ */ new Map()
    const componentPathMap = /* @__PURE__ */ new Map()
    const checkRoutes = (routes2, parentPath2 = '') => {
      routes2.forEach((route) => {
        const currentPath = route.path || ''
        const fullPath = this.resolvePath(parentPath2, currentPath)
        if (fullPath) {
          if (routePathMap.has(fullPath)) {
            warnings.push(`路由路径重复: "${fullPath}"`)
          } else {
            routePathMap.set(fullPath, String(route.name || fullPath))
          }
        }
        if (route.name) {
          const routeName = String(route.name)
          if (routeNameMap.has(routeName)) {