From bd86d5a697549264d9653de705f092bed02331fa Mon Sep 17 00:00:00 2001 From: zhangjun1 Date: Thu, 3 Nov 2022 18:48:09 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AE=A1=E7=90=86=E4=B8=AD=E5=BF=83=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E9=A6=96=E9=A1=B5=E5=85=BC=E5=AE=B9=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/router/index.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/router/index.js b/src/router/index.js index 6691a50..146ac3a 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -49,11 +49,13 @@ function inWhiteList(toPath) { router.beforeEach((to, from, next) => { const userInfo = store.state.userInfo + console.log(store.state.route); //已登录不可跳转登陆页 - if(userInfo&&to.path=='/login'){ - next({path:from.path}) + if(userInfo&&(to.path=='/login'||to.path=='/')){ + next({path:'/develop/account'}) } + // 检查to.path是否存在于免登陆白名单 if (inWhiteList(to.path)) { -- 2.26.0