Browse Source

fix[permission]: set NProgress.done #79

Pan 7 years ago
parent
commit
f4514a66cf
1 changed files with 1 additions and 0 deletions
  1. 1 0
      src/permission.js

+ 1 - 0
src/permission.js

@@ -11,6 +11,7 @@ router.beforeEach((to, from, next) => {
11
   if (getToken()) {
11
   if (getToken()) {
12
     if (to.path === '/login') {
12
     if (to.path === '/login') {
13
       next({ path: '/' })
13
       next({ path: '/' })
14
+      NProgress.done() // if current page is dashboard will not trigger	afterEach hook, so manually handle it
14
     } else {
15
     } else {
15
       if (store.getters.roles.length === 0) {
16
       if (store.getters.roles.length === 0) {
16
         store.dispatch('GetInfo').then(res => { // 拉取用户信息
17
         store.dispatch('GetInfo').then(res => { // 拉取用户信息