From 7d6da6cafcdfa746d9cc9fc7e78945a4769ec70d Mon Sep 17 00:00:00 2001 From: kun <1422840143@qq.com> Date: Thu, 14 Mar 2024 11:45:24 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20BUG=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/routers/modules/dynamicRouter.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/routers/modules/dynamicRouter.ts b/src/routers/modules/dynamicRouter.ts index 6500f64..59a1484 100644 --- a/src/routers/modules/dynamicRouter.ts +++ b/src/routers/modules/dynamicRouter.ts @@ -37,6 +37,7 @@ export const initDynamicRouter = async (params?: any, defaultUrl?: any) => { // 3.添加动态路由 let toNum = 0; // 记录跳转数,只想跳转一次 + console.log(authStore.flatMenuListGet); authStore.flatMenuListGet.forEach((item: any, index: any) => { item.children && delete item.children; if (item.component && isType(item.component) == "string") { @@ -64,7 +65,7 @@ export const initDynamicRouter = async (params?: any, defaultUrl?: any) => { router.push(item.path); ++toNum; } - if (item.path != "/" && toNum < 1 && defaultUrl) { + if (item.path != "/" && toNum < 1 && defaultUrl && item.path == defaultUrl) { router.push(defaultUrl); ++toNum; }