move auth into vuex state

This commit is contained in:
2017-02-20 11:27:23 -07:00
parent 3d082f63f5
commit 0b313f10e1
7 changed files with 49 additions and 33 deletions

49
src/router/index.js Normal file
View File

@@ -0,0 +1,49 @@
import Vue from 'vue';
import VueRouter from 'vue-router';
import App from '../App.vue';
import Login from '../pages/Login.vue';
import Customers from '../pages/Customers.vue';
import Orders from '../pages/Orders.vue';
import About from '../pages/About.vue';
Vue.use(VueRouter);
const routes = [{
path: '/login',
name: 'login',
component: Login,
}, {
path: '/',
name: 'app',
component: App,
meta: {
requiresAuthentication: true,
},
children: [
{
path: 'customers',
name: 'customers',
component: Customers,
}, {
path: 'orders',
name: 'orders',
component: Orders,
}, {
path: 'about',
name: 'about',
component: About,
}, {
path: '*',
redirect: 'customers',
},
],
}];
const router = new VueRouter({
mode: 'hash',
routes,
});
export default router;