From 343cb6adfdb3aa894f9d1578caf0f31a91983f6d Mon Sep 17 00:00:00 2001 From: kun <1422840143@qq.com> Date: Thu, 23 Nov 2023 18:50:22 +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 | 12 +++++++--- .../components/RigthBottLeftView.vue | 24 +++++++++---------- .../userManagement/roleManage/index.vue | 4 ++-- 3 files changed, 23 insertions(+), 17 deletions(-) diff --git a/src/routers/modules/dynamicRouter.ts b/src/routers/modules/dynamicRouter.ts index 5875a54..1150b18 100644 --- a/src/routers/modules/dynamicRouter.ts +++ b/src/routers/modules/dynamicRouter.ts @@ -36,7 +36,7 @@ export const initDynamicRouter = async (params?: any) => { } // 3.添加动态路由 - authStore.flatMenuListGet.forEach((item: any) => { + authStore.flatMenuListGet.forEach((item: any, index: any) => { item.children && delete item.children; if (item.component && isType(item.component) == "string") { item.component = modules["/src/views" + item.component + ".vue"]; @@ -55,11 +55,17 @@ export const initDynamicRouter = async (params?: any) => { router.addRoute("layout", item); if (globalStore.path) { // console.log("exec"); - router.push(globalStore.path); - + if (globalStore.path == item.path) { + router.push(globalStore.path); + } else { + if (item.path != "/" && index == 1) { + router.push(item.path); + } + } // globalStore.setPath(null); } else { // 其他处理 + globalStore.setPath(null); } } }); diff --git a/src/views/goverment/huizhou/largeScreen/largeScreenTwo/components/RigthBottLeftView.vue b/src/views/goverment/huizhou/largeScreen/largeScreenTwo/components/RigthBottLeftView.vue index 6b1a374..e6b0cc3 100644 --- a/src/views/goverment/huizhou/largeScreen/largeScreenTwo/components/RigthBottLeftView.vue +++ b/src/views/goverment/huizhou/largeScreen/largeScreenTwo/components/RigthBottLeftView.vue @@ -96,27 +96,27 @@