forked from kompetenzinventar/ki-frontend
router, auth, edit, first autocomplete, bascis structure, no design
This commit is contained in:
@ -9,7 +9,17 @@ const routes = [
|
||||
path: '/s',
|
||||
name: 's',
|
||||
component: {
|
||||
template: "<router-view/>"
|
||||
template: "<router-view/>",
|
||||
},
|
||||
beforeEnter: (to, from, next) => {
|
||||
console.log('test')
|
||||
console.log('token', localStorage.getItem('token'))
|
||||
if(localStorage.getItem('token') !== null){
|
||||
console.log('next')
|
||||
next()
|
||||
}else{
|
||||
next({path: '/', query: {url: to.fullPath, access: false}})
|
||||
}
|
||||
},
|
||||
children: [
|
||||
{
|
||||
@ -18,12 +28,12 @@ const routes = [
|
||||
component: Search
|
||||
},
|
||||
{
|
||||
path: '/profile/:member',
|
||||
path: 'profile/:member',
|
||||
name: 'ProfileMember',
|
||||
component: View
|
||||
},
|
||||
{
|
||||
path: '/profile-edit',
|
||||
path: 'profile-edit',
|
||||
name: 'ProfileEdit',
|
||||
component: Edit
|
||||
},
|
||||
|
Reference in New Issue
Block a user