mirror of
https://github.com/filegator/filegator.git
synced 2025-01-18 05:08:54 +01:00
35 lines
645 B
JavaScript
35 lines
645 B
JavaScript
|
import Vue from 'vue'
|
||
|
import Router from 'vue-router'
|
||
|
import Browser from './views/Browser.vue'
|
||
|
import Users from './views/Users.vue'
|
||
|
import Login from './views/Login.vue'
|
||
|
import store from './store'
|
||
|
|
||
|
Vue.use(Router)
|
||
|
|
||
|
export default new Router({
|
||
|
mode: 'hash',
|
||
|
routes: [
|
||
|
{
|
||
|
path: '/',
|
||
|
name: 'browser',
|
||
|
component: Browser,
|
||
|
},
|
||
|
{
|
||
|
path: '/login',
|
||
|
name: 'login',
|
||
|
component: Login,
|
||
|
},
|
||
|
{
|
||
|
path: '/users',
|
||
|
name: 'users',
|
||
|
component: Users,
|
||
|
beforeEnter: (to, from, next) => {
|
||
|
if (store.state.user.role == 'admin') {
|
||
|
next()
|
||
|
}
|
||
|
},
|
||
|
},
|
||
|
]
|
||
|
})
|