From 6c34a2b3c0a2e553898d959ce39edb9cff5b0ad2 Mon Sep 17 00:00:00 2001 From: lipeng Date: Tue, 11 Jul 2023 16:23:29 +0800 Subject: [PATCH] =?UTF-8?q?=E9=AA=8C=E8=AF=81=E7=A0=81=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/bg-menu.vue | 2 +- src/components/login-by-code.vue | 2 +- src/router/function.js | 5 ++++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/components/bg-menu.vue b/src/components/bg-menu.vue index 58bbe11..59e0012 100644 --- a/src/components/bg-menu.vue +++ b/src/components/bg-menu.vue @@ -242,7 +242,7 @@ export default { pathToUrl(item, parent) { //判断是否是新窗口打开 if (item.new_window) { - window.open(item.path, "_blank"); + window.open(item.sourcePath ? item.sourcePath : item.path, "_blank"); } else { // 当前窗口打开 if (item.path.indexOf("#") > -1) { diff --git a/src/components/login-by-code.vue b/src/components/login-by-code.vue index 5138b20..9fdc3a8 100644 --- a/src/components/login-by-code.vue +++ b/src/components/login-by-code.vue @@ -166,7 +166,7 @@ const getUser = () => { store.commit("setMenuObj", menuObj); // } generateRoutes(); - router.push("/"); + router.push("/forewarning/list"); } }); }; diff --git a/src/router/function.js b/src/router/function.js index 472bf5e..b01a8aa 100644 --- a/src/router/function.js +++ b/src/router/function.js @@ -278,7 +278,10 @@ function getViews(path) { var menuToRouter = (menu) => { menu.forEach((e) => { e.name = getName(e.path); - if (e.path.indexOf("#") != -1 && e.new_window !== 1) { + if (e.path.indexOf("#") != -1) { + if (e.path.indexOf("http") === 0) { + e.sourcePath = e.path; + } e.path = e.path.split("#")[1]; } if (e.children && e.menuType == 0) { -- 2.26.0