From 3505aa60ad15de91bc9b437ca8d69124c8074974 Mon Sep 17 00:00:00 2001 From: Ben Lin <maobin001@msn.com> Date: 星期二, 25 六月 2024 11:42:28 +0800 Subject: [PATCH] 通用页面更新 --- src/router/helper/routeHelper.ts | 15 +++++++++++---- 1 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/router/helper/routeHelper.ts b/src/router/helper/routeHelper.ts index d133209..a96b06b 100644 --- a/src/router/helper/routeHelper.ts +++ b/src/router/helper/routeHelper.ts @@ -1,13 +1,13 @@ -import type { AppRouteModule, AppRouteRecordRaw } from '/@/router/types'; +import type { AppRouteModule, AppRouteRecordRaw } from '@/router/types'; import type { Router, RouteRecordNormalized } from 'vue-router'; -import { getParentLayout, LAYOUT, EXCEPTION_COMPONENT } from '/@/router/constant'; +import { getParentLayout, LAYOUT, EXCEPTION_COMPONENT } from '@/router/constant'; import { cloneDeep, omit } from 'lodash-es'; -import { warn } from '/@/utils/log'; +import { warn } from '@/utils/log'; import { createRouter, createWebHashHistory } from 'vue-router'; export type LayoutMapKey = 'LAYOUT'; -const IFRAME = () => import('/@/views/sys/iframe/FrameBlank.vue'); +const IFRAME = () => import('@/views/sys/iframe/FrameBlank.vue'); const LayoutMap = new Map<string, () => Promise<typeof import('*.vue')>>(); @@ -78,7 +78,14 @@ } else { route.children = [cloneDeep(route)]; route.component = LAYOUT; + + //鏌愪簺鎯呭喌涓嬪鏋渘ame濡傛灉娌℃湁鍊硷紝 澶氫釜涓�绾ц矾鐢辫彍鍗曚細瀵艰嚧椤甸潰404 + if (!route.name) { + warn('鎵句笉鍒拌彍鍗曞搴旂殑name, 璇锋鏌ユ暟鎹�!' + JSON.stringify(route)); + } route.name = `${route.name}Parent`; + // 閲嶅畾鍚戝埌褰撳墠璺敱锛屼互闃茬┖鐧介〉闈� + route.redirect = route.path; route.path = ''; const meta = route.meta || {}; meta.single = true; -- Gitblit v1.9.3