import Vue from 'vue';
import VueRouter from 'vue-router';



Vue.use(VueRouter);




const router = new VueRouter({
    mode: 'history',

    routes: [{
        path: '/',
        name: 'index',
        redirect: 'freelist',
        meta: {
            title: '统计首页',
        },
    }, {
        path: '/statics',
        name: 'statics',
        component: () =>
            import ('./../view/statics.vue'),
        meta: {
            title: '统计首页',
        },
    }, {
        path: '/freelist',
        name: 'freelist',
        component: () =>
            import ('./../view/freelist.vue'),
        meta: {
            title: '免单列表',
        },
    }, {
        path: '/prizemessage',
        name: 'prizemessage',
        component: () =>
            import ('./../view/prizemessage.vue'),
        meta: {
            title: '免单留言',
        },
    }, {
        path: '/orderdata',
        name: 'orderdata',
        component: () =>
            import ('./../view/orderdata.vue'),
        meta: {
            title: '免单统计',
        },
    }, {
        path: '/authdata',
        name: 'authdata',
        component: () =>
            import ('./../view/authdata.vue'),
        meta: {
            title: '授权页面',
        },
    }]
})

// if (localStorage.getItem('route')) {
//     route = JSON.parse(localStorage.getItem('route'))
// } else {
//     let result = await http.getRoute()
//     route = result.data
// }

// router.addRoutes(route)


export default router;