|
@@ -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 => { // 拉取用户信息
|