diff --git a/src/permission.js b/src/permission.js index e1d1533c..a56c9d89 100644 --- a/src/permission.js +++ b/src/permission.js @@ -19,7 +19,7 @@ const whiteList = ['/login', '/authredirect']// no redirect whitelist router.beforeEach((to, from, next) => { NProgress.start() // 开启Progress const token = getToken() - if (typeof (token) === 'undefined') { // 判断是否有token + if (typeof (token) !== 'undefined') { // 判断是否有token if (to.path === '/login') { next({ path: '/' }) NProgress.done() // if current page is dashboard will not trigger afterEach hook, so manually handle it