Skip to content

Commit 87a44ae

Browse files
committed
doc: add note for NProgress.done
1 parent 1c852db commit 87a44ae

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/permission.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ router.beforeEach((to, from, next) => {
1818
if (getToken()) { // 判断是否有token
1919
if (to.path === '/login') {
2020
next({ path: '/' })
21-
NProgress.done()
21+
NProgress.done() // router在hash模式下 手动改变hash 重定向回来 不会触发afterEach 暂时hack方案 ps:history模式下无问题,可删除该行!
2222
} else {
2323
if (store.getters.roles.length === 0) { // 判断当前用户是否已拉取完user_info信息
2424
store.dispatch('GetUserInfo').then(res => { // 拉取user_info
@@ -38,7 +38,7 @@ router.beforeEach((to, from, next) => {
3838
next()//
3939
} else {
4040
next({ path: '/401', query: { noGoBack: true }})
41-
NProgress.done()
41+
NProgress.done() // router在hash模式下 手动改变hash 重定向回来 不会触发afterEach 暂时hack方案 ps:history模式下无问题,可删除该行!
4242
}
4343
// 可删 ↑
4444
}
@@ -48,7 +48,7 @@ router.beforeEach((to, from, next) => {
4848
next()
4949
} else {
5050
next('/login') // 否则全部重定向到登录页
51-
NProgress.done() // 在hash模式下 改变手动改变hash 重定向回来 不会触发afterEach 暂时hack方案 ps:history模式下无问题,可删除该行!
51+
NProgress.done() // router在hash模式下 手动改变hash 重定向回来 不会触发afterEach 暂时hack方案 ps:history模式下无问题,可删除该行!
5252
}
5353
}
5454
})

0 commit comments

Comments
 (0)