Commit f4514a66 authored by Pan's avatar Pan

fix[permission]: set NProgress.done #79

parent 6fa3f104
...@@ -11,6 +11,7 @@ router.beforeEach((to, from, next) => { ...@@ -11,6 +11,7 @@ router.beforeEach((to, from, next) => {
if (getToken()) { if (getToken()) {
if (to.path === '/login') { if (to.path === '/login') {
next({ path: '/' }) next({ path: '/' })
NProgress.done() // if current page is dashboard will not trigger afterEach hook, so manually handle it
} else { } else {
if (store.getters.roles.length === 0) { if (store.getters.roles.length === 0) {
store.dispatch('GetInfo').then(res => { // 拉取用户信息 store.dispatch('GetInfo').then(res => { // 拉取用户信息
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment