feature: add a redirect url when not logged in

https://github.com/PanJiaChen/vue-element-admin/issues/438
This commit is contained in:
Pan
2018-09-07 17:15:09 +08:00
parent 337b12bea7
commit ccd07c3d63
2 changed files with 12 additions and 3 deletions

View File

@@ -30,7 +30,7 @@ router.beforeEach((to, from, next) => {
if (whiteList.indexOf(to.path) !== -1) {
next()
} else {
next('/login')
next(`/login?redirect=${to.path}`) // 否则全部重定向到登录页
NProgress.done()
}
}