mirror of
https://github.com/PanJiaChen/vue-element-admin.git
synced 2025-09-09 18:17:21 +08:00
Merge bb9bff00af3ae782f06b0141038353609ad3de70 into 3cc3e134c2314f9b5df0f79de1e0272d6e00b633
This commit is contained in:
commit
89b061ae5c
@ -17,9 +17,9 @@ function hasPermission(roles, permissionRoles) {
|
||||
const whiteList = ['/login', '/authredirect']// no redirect whitelist
|
||||
|
||||
router.beforeEach((to, from, next) => {
|
||||
NProgress.start() // start progress bar
|
||||
if (getToken()) { // determine if there has token
|
||||
/* has token*/
|
||||
NProgress.start() // 开启Progress
|
||||
const token = getToken()
|
||||
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
|
||||
|
Loading…
x
Reference in New Issue
Block a user