From 3bb31de1b7cd170f683f3916fc7566511625d6a8 Mon Sep 17 00:00:00 2001 From: dai <851733175@qq.com> Date: Mon, 14 Mar 2022 14:58:17 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E8=B7=AF=E7=94=B1=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/router/index.js | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/src/router/index.js b/src/router/index.js index 75966340..1211047a 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -328,9 +328,9 @@ router.beforeEach((to, from, next) => { .then(({ data: res }) => { if (res.code !== 0) { // Vue.prototype.$message.error(res.msg) - return next({ - name: "login", - }); + // return next({ + // name: "login", + // }); } window.SITE_CONFIG["menuList"] = res.data; fnAddDynamicMenuRoutes(window.SITE_CONFIG["menuList"]); @@ -341,9 +341,9 @@ router.beforeEach((to, from, next) => { }); }) .catch(() => { - next({ - name: "login", - }); + // next({ + // name: "login", + // }); }); }); @@ -397,14 +397,20 @@ function fnAddDynamicMenuRoutes(menuList = [], routes = []) { route["meta"]["iframeURL"] = URL; } else { URL = URL.replace(/^\//, "").replace(/_/g, "-"); - route["path"] = route["name"] = URL.replace(/\//g, "-"); - route["component"] = () => import(`@/views/modules/${URL}`); + if (menuList[i].children && menuList[i].children.length >= 1) { + route["path"] = route["name"] = URL; + route["redirect"] = URL.replace(/\//g, "-"); + } else { + route["path"] = route["name"] = URL.replace(/\//g, "-"); + route["component"] = () => import(`@/views/modules/${URL}`); + } } routes.push(route); } if (temp.length >= 1) { return fnAddDynamicMenuRoutes(temp, routes); } + // routers.reverse(); // 添加路由 router.addRoutes([ { From fe4b87ad084ddf30110f9850622d4f3d9279ae3d Mon Sep 17 00:00:00 2001 From: dai <851733175@qq.com> Date: Tue, 15 Mar 2022 10:05:38 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/communityService/dqfwzx/index.vue | 244 +++++++++++------- .../modules/communityService/sqzzz/index.vue | 8 +- 2 files changed, 148 insertions(+), 104 deletions(-) diff --git a/src/views/modules/communityService/dqfwzx/index.vue b/src/views/modules/communityService/dqfwzx/index.vue index 0b2265aa..f5b5b873 100644 --- a/src/views/modules/communityService/dqfwzx/index.vue +++ b/src/views/modules/communityService/dqfwzx/index.vue @@ -2,23 +2,26 @@