|
|
@@ -57,7 +57,13 @@ router.beforeEach((to, from, next) => { |
|
|
|
}).catch(err => { |
|
|
|
store.dispatch('LogOut').then(() => { |
|
|
|
// Message.error(err) |
|
|
|
next({ path: '/' }) |
|
|
|
if ('/authenticRight/index'.indexOf(to.path) !== -1) { |
|
|
|
next({ path: '/authenticRight/login' }) |
|
|
|
} else if ('/homestead/index'.indexOf(to.path) !== -1) { |
|
|
|
next({ path: '/homestead/login' }) |
|
|
|
} else { |
|
|
|
next({ path: '/' }) |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
} else { |
|
|
@@ -70,7 +76,9 @@ router.beforeEach((to, from, next) => { |
|
|
|
// 在免登录白名单,直接进入 |
|
|
|
next() |
|
|
|
} else { |
|
|
|
if ('/homestead/index'.indexOf(to.path) !== -1) { |
|
|
|
if ('/authenticRight/index'.indexOf(to.path) !== -1) { |
|
|
|
next(`/authenticRight/login?redirect=${to.fullPath}`) |
|
|
|
} else if ('/homestead/index'.indexOf(to.path) !== -1) { |
|
|
|
next(`/homestead/login?redirect=${to.fullPath}`) |
|
|
|
} else { |
|
|
|
next(`/login?redirect=${to.fullPath}`) |
|
|
|