index.js 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. import Vue from 'vue';
  2. import VueRouter from 'vue-router';
  3. import checkLogin from './before';
  4. Vue.use(VueRouter);
  5. const routes = [
  6. {
  7. path: '/',
  8. meta: { title: '首页' },
  9. component: () => import('../views/index.vue'),
  10. },
  11. {
  12. path: '/anchor/index',
  13. meta: { title: '主播管理' },
  14. component: () => import('../views/anchor/index.vue'),
  15. },
  16. {
  17. path: '/anchor/detail',
  18. meta: { title: '主播详情' },
  19. component: () => import('../views/anchor/detail.vue'),
  20. },
  21. {
  22. path: '/role/index',
  23. meta: { title: '菜单管理' },
  24. component: () => import('../views/role/index.vue'),
  25. },
  26. {
  27. path: '/role/detail',
  28. meta: { title: '菜单详情' },
  29. component: () => import('../views/role/detail.vue'),
  30. },
  31. {
  32. path: '/live/index',
  33. meta: { title: '直播管理' },
  34. component: () => import('../views/live/index.vue'),
  35. },
  36. {
  37. path: '/room/index',
  38. meta: { title: '房间管理' },
  39. component: () => import('../views/room/index.vue'),
  40. },
  41. {
  42. path: '/room/detail',
  43. meta: { title: '房间详情' },
  44. component: () => import('../views/room/detail.vue'),
  45. },
  46. {
  47. path: '/stat/index',
  48. meta: { title: '统计管理' },
  49. component: () => import('../views/stat/index.vue'),
  50. },
  51. {
  52. path: '/test/index',
  53. meta: { title: '测试管理' },
  54. component: () => import('../views/test/index.vue'),
  55. },
  56. {
  57. path: '/test/detail',
  58. meta: { title: '添加' },
  59. component: () => import('../views/test/detail.vue'),
  60. },
  61. {
  62. path: '/login',
  63. meta: { title: '登录' },
  64. component: () => import('../views/login.vue'),
  65. },
  66. ];
  67. const router = new VueRouter({
  68. mode: 'history',
  69. base: process.env.NODE_ENV === 'development' ? '' : process.env.VUE_APP_ROUTER,
  70. routes,
  71. });
  72. checkLogin(router);
  73. export default router;