Commit d9d2cb7b by Jay

.

parent 1f1c9e78
......@@ -14,7 +14,7 @@ Vue.config.productionTip = false;
router.beforeEach((to, from, next) => {
// document.title = to.meta.title;
const isLogin = localStorage.getItem('authJWT') ? true : false;
if (isLogin) {
if (isLogin && JSON.parse(atob(localStorage.getItem('authJWT').split('.')[1])).level !== undefined) {
if (to.path === '/login') {
next('/home');
} else if (to.path === '/') {
......@@ -39,13 +39,7 @@ router.beforeEach((to, from, next) => {
next();
} else {
localStorage.setItem('lastUrl', to.fullPath);
// this.$router.push({ name: 'login', query: { redirect: '/path' } });
next({
path: '/login',
query: {
nextUrl: to.fullPath
}
});
next('/login');
}
}
});
......
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