From 9d8e6f08de6a793e1e719fa763b512360409f7e1 Mon Sep 17 00:00:00 2001 From: piexlmax <303176530@qq.com> Date: Sat, 1 Jan 2022 20:06:13 +0800 Subject: [PATCH] =?UTF-8?q?=E7=99=BB=E5=BD=95=E5=90=8E=E8=B0=83=E6=95=B4?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E8=8F=9C=E5=8D=95=E9=80=BB=E8=BE=91=EF=BC=8C?= =?UTF-8?q?=E4=B8=8D=E5=86=8D=E9=87=8D=E5=A4=8D=E8=AF=B7=E6=B1=82getMenu?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/permission.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/web/src/permission.js b/web/src/permission.js index 6a301477..d3f724fe 100644 --- a/web/src/permission.js +++ b/web/src/permission.js @@ -38,7 +38,7 @@ router.beforeEach(async(to, from, next) => { document.title = getPageTitle(to.meta.title) if (whiteList.indexOf(to.name) > -1) { if (token) { - if (!asyncRouterFlag) { + if (!asyncRouterFlag && whiteList.indexOf(from.name) < 0) { asyncRouterFlag++ await getRouter() } @@ -50,10 +50,9 @@ router.beforeEach(async(to, from, next) => { // 不在白名单中并且已经登陆的时候 if (token) { // 添加flag防止多次获取动态路由和栈溢出 - if (!asyncRouterFlag) { + if (!asyncRouterFlag && whiteList.indexOf(from.name) < 0) { asyncRouterFlag++ await getRouter() - next({...to, replace: true }) } else { if (to.matched.length) {