index.js 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. import Vue from 'vue';
  2. import VueRouter from 'vue-router';
  3. import checkLogin from '@common/router/before';
  4. Vue.use(VueRouter);
  5. const routes = [
  6. // 首页
  7. {
  8. path: '/',
  9. meta: { title: '首页管理' },
  10. component: () => import('../views/home/index.vue'),
  11. },
  12. // 菜单管理
  13. {
  14. path: '/menu/index',
  15. meta: { title: '菜单管理' },
  16. component: () => import('../views/menu/index.vue'),
  17. },
  18. // 用戶管理
  19. // 个人与企业
  20. {
  21. path: '/user/index',
  22. meta: { title: '个人&企业用户管理' },
  23. component: () => import('../views/user/index.vue'),
  24. },
  25. // 添加+修改
  26. {
  27. path: '/user/detail',
  28. meta: { title: '个人&企业用户信息管理' },
  29. component: () => import('../views/user/detail.vue'),
  30. },
  31. // 专家
  32. {
  33. path: '/user/exportIndex',
  34. meta: { title: '专家用户管理' },
  35. component: () => import('../views/user/exportIndex.vue'),
  36. },
  37. // 临时
  38. {
  39. path: '/user/temporaryIndex',
  40. meta: { title: '临时用户管理' },
  41. component: () => import('../views/user/temporaryIndex.vue'),
  42. },
  43. // 部门管理
  44. {
  45. path: '/department/index',
  46. meta: { title: '部门管理' },
  47. component: () => import('../views/department/index.vue'),
  48. },
  49. //产品供求审核管理
  50. {
  51. path: '/enterpriseProduct/index',
  52. meta: { title: '产品供求审核管理' },
  53. component: () => import('../views/enterpriseProduct/index.vue'),
  54. },
  55. //产品供求交易状态审核管理
  56. {
  57. path: '/enterpriseTrans/index',
  58. meta: { title: '产品供求交易状态审核管理' },
  59. component: () => import('../views/enterpriseTrans/index.vue'),
  60. },
  61. //科技超市发起交易审核详情
  62. {
  63. path: '/enterpriseTrans/detail',
  64. component: () => import('../views/enterpriseTrans/detail.vue'),
  65. },
  66. //科技超市交易审核管理
  67. {
  68. path: '/enterpriseTrans/jiaoyidetail',
  69. component: () => import('../views/enterpriseTrans/jiaoyidetail.vue'),
  70. },
  71. //技术培训
  72. {
  73. path: '/technical/index',
  74. meta: { title: '技术培训' },
  75. component: () => import('../views/technical/index.vue'),
  76. },
  77. // 技术培训-栏目列表
  78. {
  79. path: '/technical/columnDetail',
  80. component: () => import('../views/technical/columnDetail.vue'),
  81. },
  82. // 技术培训-信息列表
  83. {
  84. path: '/technical/messageInfoDetail',
  85. component: () => import('../views/technical/messageInfoDetail.vue'),
  86. },
  87. //字典管理
  88. {
  89. path: '/dictionary/index',
  90. meta: { title: '字典管理' },
  91. component: () => import('../views/dictionary/index.vue'),
  92. },
  93. ];
  94. const router = new VueRouter({
  95. mode: 'history',
  96. base: process.env.NODE_ENV === 'development' ? '' : process.env.VUE_APP_ROUTER,
  97. routes,
  98. });
  99. checkLogin(router, () => {
  100. let url = process.env.NODE_ENV === 'development' ? null : `/platlive/login`;
  101. if (url) window.location.href = url;
  102. else console.log('开发环境自己弄');
  103. });
  104. export default router;