diff --git a/src/permission.js b/src/permission.js index 43c1cc59..49a03e27 100644 --- a/src/permission.js +++ b/src/permission.js @@ -15,7 +15,8 @@ function hasPermission(roles, permissionRoles) { const whiteList = ['/login', '/authredirect', '/reset', '/sendpwd']// 不重定向白名单 router.beforeEach((to, from, next) => { NProgress.start() // 开启Progress - if (getToken()) { // 判断是否有token + const token = getToken() + if (typeof (token) === 'undefined') { // 判断是否有token if (to.path === '/login') { next({ path: '/' }) } else {