mirror of
https://github.com/PanJiaChen/vue-element-admin.git
synced 2025-09-01 13:39:49 +08:00
移除无用的NProgress.done()(/src/permission.js)
router.afterEach 足够关闭所有的进度条
This commit is contained in:
parent
6850312e89
commit
1315899493
@ -24,7 +24,6 @@ router.beforeEach(async(to, from, next) => {
|
||||
if (to.path === '/login') {
|
||||
// if is logged in, redirect to the home page
|
||||
next({ path: '/' })
|
||||
NProgress.done()
|
||||
} else {
|
||||
// determine whether the user has obtained his permission roles through getInfo
|
||||
const hasRoles = store.getters.roles && store.getters.roles.length > 0
|
||||
@ -50,7 +49,6 @@ router.beforeEach(async(to, from, next) => {
|
||||
await store.dispatch('user/resetToken')
|
||||
Message.error(error || 'Has Error')
|
||||
next(`/login?redirect=${to.path}`)
|
||||
NProgress.done()
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -63,7 +61,6 @@ router.beforeEach(async(to, from, next) => {
|
||||
} else {
|
||||
// other pages that do not have permission to access are redirected to the login page.
|
||||
next(`/login?redirect=${to.path}`)
|
||||
NProgress.done()
|
||||
}
|
||||
}
|
||||
})
|
||||
|
Loading…
x
Reference in New Issue
Block a user