fix:fix undone NProgress.
This commit is contained in:
parent
9463c50e06
commit
1c852db0ef
|
@ -18,6 +18,7 @@ router.beforeEach((to, from, next) => {
|
||||||
if (getToken()) { // 判断是否有token
|
if (getToken()) { // 判断是否有token
|
||||||
if (to.path === '/login') {
|
if (to.path === '/login') {
|
||||||
next({ path: '/' })
|
next({ path: '/' })
|
||||||
|
NProgress.done()
|
||||||
} else {
|
} else {
|
||||||
if (store.getters.roles.length === 0) { // 判断当前用户是否已拉取完user_info信息
|
if (store.getters.roles.length === 0) { // 判断当前用户是否已拉取完user_info信息
|
||||||
store.dispatch('GetUserInfo').then(res => { // 拉取user_info
|
store.dispatch('GetUserInfo').then(res => { // 拉取user_info
|
||||||
|
@ -37,6 +38,7 @@ router.beforeEach((to, from, next) => {
|
||||||
next()//
|
next()//
|
||||||
} else {
|
} else {
|
||||||
next({ path: '/401', query: { noGoBack: true }})
|
next({ path: '/401', query: { noGoBack: true }})
|
||||||
|
NProgress.done()
|
||||||
}
|
}
|
||||||
// 可删 ↑
|
// 可删 ↑
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue