This commit is contained in:
@@ -41,38 +41,11 @@ export default new Router({
|
||||
// which is lazy-loaded when the route is visited.
|
||||
component: () =>
|
||||
import(/* webpackChunkName: "about" */ "./views/About.vue")
|
||||
},
|
||||
{
|
||||
path: "/log",
|
||||
name: "log",
|
||||
component: () => import(/* webpackChunkName: "log" */ "./views/log.vue")
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
// Router.beforeEach((to, from, next) => {
|
||||
// if(to.matched.some(record => record.meta.requiresAuth)) {
|
||||
// if (localStorage.getItem('jwt') == null) {
|
||||
// next({
|
||||
// path: '/login',
|
||||
// params: { nextUrl: to.fullPath }
|
||||
// })
|
||||
// } else {
|
||||
// let user = JSON.parse(localStorage.getItem('user'))
|
||||
// if(to.matched.some(record => record.meta.is_admin)) {
|
||||
// if(user.is_admin == 1){
|
||||
// next()
|
||||
// }
|
||||
// else{
|
||||
// next({ name: 'userboard'})
|
||||
// }
|
||||
// }else {
|
||||
// next()
|
||||
// }
|
||||
// }
|
||||
// } else if(to.matched.some(record => record.meta.guest)) {
|
||||
// if(localStorage.getItem('jwt') == null){
|
||||
// next()
|
||||
// }
|
||||
// else{
|
||||
// next({ name: 'userboard'})
|
||||
// }
|
||||
// }else {
|
||||
// next()
|
||||
// }
|
||||
// })
|
||||
|
||||
Reference in New Issue
Block a user