From 6eaddcbd5885452925200ad5add9ba0bb686d4a4 Mon Sep 17 00:00:00 2001 From: jmal Date: Sun, 24 Jul 2022 12:12:27 +0800 Subject: [PATCH] =?UTF-8?q?:bug:fix(*):=20=E4=BC=98=E5=8C=96=E7=99=BB?= =?UTF-8?q?=E9=99=86=E5=A4=B1=E6=95=88=E5=90=8E=E8=B7=B3=E8=BD=AC=E5=88=B0?= =?UTF-8?q?=E7=99=BB=E9=99=86=E7=95=8C=E9=9D=A2=E5=88=B0=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/permission.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/permission.js b/src/permission.js index e7facb4..d0bc280 100644 --- a/src/permission.js +++ b/src/permission.js @@ -41,9 +41,10 @@ router.beforeEach(async(to, from, next) => { // 删除token,然后转到登录页面重新登录 await store.dispatch('user/resetToken') if (to.path === '/404') { - to.path = '/' + next(`/login`) + } else { + next(`/login?redirect=${to.path}`) } - next(`/login?redirect=${to.path}`) NProgress.done() } } @@ -102,6 +103,7 @@ function findPath(menuList, to, parentPath){ } } if(parentPath){ + console.log("parentPath", parentPath) menu.path = parentPath + '/' + menu.path } if(menu.path === to) return true