index.js 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. import Vue from 'vue';
  2. import VueRouter from 'vue-router';
  3. const originalPush = VueRouter.prototype.push;
  4. VueRouter.prototype.push = function push(location) {
  5. return originalPush.call(this, location).catch((err) => err);
  6. };
  7. Vue.use(VueRouter);
  8. // 信息展示
  9. const infoview = [
  10. {
  11. path: '/infoview-laboratory/index',
  12. meta: { title: '重点实验室信息展示' },
  13. component: () => import('../views/infoview-laboratory/index.vue'),
  14. },
  15. {
  16. path: '/infoview-research/index',
  17. meta: { title: '研究方向信息展示' },
  18. component: () => import('../views/infoview-research/index.vue'),
  19. },
  20. {
  21. path: '/infoview-equipment/index',
  22. meta: { title: '设备信息展示' },
  23. component: () => import('../views/infoview-equipment/index.vue'),
  24. },
  25. {
  26. path: '/infoview-achievement/index',
  27. meta: { title: '重要成果信息展示' },
  28. component: () => import('../views/infoview-achievement/index.vue'),
  29. },
  30. ];
  31. // 科研信息
  32. const scientific = [
  33. {
  34. path: '/scientific/index',
  35. meta: { title: '科研信息' },
  36. component: () => import('../views/scientific/index.vue'),
  37. },
  38. {
  39. path: '/scientific/personnel/index',
  40. meta: { title: '主任及科研助理信息列表' },
  41. component: () => import('../views/scientific/personnel/index.vue'),
  42. },
  43. {
  44. path: '/scientific/learning/index',
  45. meta: { title: '学术委员会' },
  46. component: () => import('../views/scientific/learning/index.vue'),
  47. },
  48. {
  49. path: '/scientific/task/index',
  50. meta: { title: '实验室建设期内承担项目明细' },
  51. component: () => import('../views/scientific/task/index.vue'),
  52. },
  53. {
  54. path: '/scientific/award/index',
  55. meta: { title: '实验室建设期内获奖明细' },
  56. component: () => import('../views/scientific/award/index.vue'),
  57. },
  58. {
  59. path: '/scientific/paper/index',
  60. meta: { title: '实验室建设期内发表学术论文明细' },
  61. component: () => import('../views/scientific/paper/index.vue'),
  62. },
  63. {
  64. path: '/scientific/achieve/index',
  65. meta: { title: '成果展示' },
  66. component: () => import('../views/scientific/achieve/index.vue'),
  67. },
  68. {
  69. path: '/scientific/otherachieve/index',
  70. meta: { title: '其他成果' },
  71. component: () => import('../views/scientific/otherachieve/index.vue'),
  72. },
  73. ];
  74. // 学术交流
  75. const learning = [
  76. {
  77. path: '/learning/index',
  78. meta: { title: '学术交流' },
  79. component: () => import('../views/learning/index.vue'),
  80. },
  81. {
  82. path: '/learning/sociology/index',
  83. meta: { title: '社会服务活动' },
  84. component: () => import('../views/learning/sociology/index.vue'),
  85. },
  86. {
  87. path: '/learning/technology/index',
  88. meta: { title: '技术服务活动' },
  89. component: () => import('../views/learning/technology/index.vue'),
  90. },
  91. {
  92. path: '/learning/science/index',
  93. meta: { title: '科普活动' },
  94. component: () => import('../views/learning/science/index.vue'),
  95. },
  96. {
  97. path: '/learning/report/index',
  98. meta: { title: '分析/建议/决策/咨询报告' },
  99. component: () => import('../views/learning/report/index.vue'),
  100. },
  101. ];
  102. // 队伍建设与人才培养;
  103. const ranks = [
  104. {
  105. path: '/ranks/index',
  106. meta: { title: '队伍建设与人才培养' },
  107. component: () => import('../views/ranks/index.vue'),
  108. },
  109. {
  110. path: '/ranks/personnel/index',
  111. meta: { title: '人才称号' },
  112. component: () => import('../views/ranks/personnel/index.vue'),
  113. },
  114. {
  115. path: '/ranks/title/index',
  116. meta: { title: '职称晋升' },
  117. component: () => import('../views/ranks/title/index.vue'),
  118. },
  119. {
  120. path: '/ranks/boshuo/index',
  121. meta: { title: '博硕培养' },
  122. component: () => import('../views/ranks/boshuo/index.vue'),
  123. },
  124. ];
  125. // 平台活动时间段公式;
  126. const activity = [
  127. {
  128. path: '/activity-time/index',
  129. meta: { title: '平台活动时间段公示' },
  130. component: () => import('../views/activity-time/index.vue'),
  131. },
  132. ];
  133. const web = [
  134. {
  135. path: '/',
  136. meta: { title: '网站首页' },
  137. component: () => import('../views/index.vue'),
  138. },
  139. // 信息展示
  140. ...infoview,
  141. // 科研信息
  142. ...scientific,
  143. // 学术交流
  144. ...learning,
  145. // 队伍建设与人才培养
  146. ...ranks,
  147. // 平台活动时间段公式
  148. ...activity,
  149. ];
  150. const routes = [...web];
  151. const router = new VueRouter({
  152. mode: 'history',
  153. base: process.env.VUE_APP_ROUTER,
  154. routes,
  155. });
  156. // router.beforeEach((to, from, next) => {
  157. // document.title = `${to.meta.title} `;
  158. // const token = localStorage.getItem('token');
  159. // // 不带参数
  160. // if (to.path == '/work/userCenter/index') {
  161. // if (!token) {
  162. // next(`/login?path=${to.path}&&type=2`);
  163. // } else {
  164. // let user = jwt.decode(token);
  165. // store.commit('setUser', user, { root: true });
  166. // next();
  167. // }
  168. // } else {
  169. // let user = jwt.decode(token);
  170. // store.commit('setUser', user, { root: true });
  171. // next();
  172. // }
  173. // });
  174. export default router;