diff --git a/src/router/index.js b/src/router/index.js index 6691a503f8a04841fff7042d230b5b2f11470326..146ac3aafdfd532bc4a91e1c25defa7d096a3ccb 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)) {