From 393c2840727d5e3dad0eeb568ab4029bf622b8b3 Mon Sep 17 00:00:00 2001 From: daxiongYang Date: Thu, 13 Sep 2018 16:44:37 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A4=E6=96=AD=E5=BD=93=E5=89=8D=E8=B7=AF?= =?UTF-8?q?=E7=94=B1=E7=B1=BB=E5=9E=8B=20bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/router/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/router/index.js b/src/router/index.js index 0fb1481d..e1a5dc3a 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -59,7 +59,7 @@ router.beforeEach((to, from, next) => { // 添加动态(菜单)路由 // 1. 已经添加 or 全局路由, 直接访问 // 2. 获取菜单列表, 添加并保存本地存储 - if (router.options.isAddDynamicMenuRoutes || fnCurrentRouteType(to) === 'global') { + if (router.options.isAddDynamicMenuRoutes || fnCurrentRouteType(to, globalRoutes) === 'global') { next() } else { http({ @@ -89,7 +89,7 @@ router.beforeEach((to, from, next) => { * 判断当前路由类型, global: 全局路由, main: 主入口路由 * @param {*} route 当前路由 */ -function fnCurrentRouteType (route) { +function fnCurrentRouteType (route, globalRoutes = []) { var temp = [] for (var i = 0; i < globalRoutes.length; i++) { if (route.path === globalRoutes[i].path) {