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

Vue.use(VueRouter);

const routes = [
  {
    path: '/',
    meta: { title: '首页' },
    component: () => import('../views/index.vue'),
  },
  {
    path: '/user/index',
    meta: { title: '用户管理' },
    component: () => import('../views/user/index.vue'),
  },
  {
    path: '/role/index',
    meta: { title: '权限管理' },
    component: () => import('../views/role/index.vue'),
  },
  {
    path: '/live/index',
    meta: { title: '直播管理' },
    component: () => import('../views/live/index.vue'),
  },
  {
    path: '/room/index',
    meta: { title: '房间管理' },
    component: () => import('../views/room/index.vue'),
  },
  {
    path: '/stat/index',
    meta: { title: '统计管理' },
    component: () => import('../views/stat/index.vue'),
  },
];

const router = new VueRouter({
  mode: 'history',
  base: process.env.NODE_ENV === 'development' ? '' : process.env.VUE_APP_ROUTER,
  routes,
});

export default router;
