import Vue from 'vue'
import Router from 'vue-router'
import config from '../config'
Vue.use(Router)
export default new Router({
  mode: 'history',
  base: `/${config.project}/`,
  routes: [
    {
      path: '/',
      redirect: '/home',
      component: () => import(/* webpackChunkName: 'wxhome' */ 'pages/home')
    },
    {
      path: '/login',
      name: 'Login',
      component: () => import(/* webpackChunkName: 'wxlogin' */ 'pages/login')
    },
    {
      path: '/home',
      name: 'Home',
      component: () => import(/* web packChunkName: 'wxhome' */ 'pages/home'),
      children: [
        {
          path: 'marketing',
          name: 'marketing',
          component: () =>
            import(/* webpackChunkName: 'marketing' */ 'pages/marketing-center')
        },
        {
          path: 'addmarketing',
          name: 'addmarketing',
          component: () =>
            import(/* webpackChunkName: 'wxlogin' */ 'pages/addmarketing')
        }
      ]
    }
  ]
})
