index.js 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314
  1. import Vue from 'vue'
  2. import VueRouter from 'vue-router'
  3. import Layout from '@/layout'
  4. import store from '@/store'
  5. Vue.use(VueRouter)
  6. const routes = [
  7. {
  8. path: '/',
  9. component: Layout,
  10. children: [
  11. {
  12. path: '',
  13. name: 'Index',
  14. component: () => import('@/views/Home/HomeIndex.vue'),
  15. meta: {
  16. title: '首页'
  17. }
  18. },
  19. {
  20. path: 'policyadvice',
  21. name: 'PolicyAdvice',
  22. component: () => import('@/views/PolicyAdvice/PolicyAdviceIndex.vue'),
  23. meta: {
  24. title: '政策咨询'
  25. }
  26. },
  27. {
  28. path: 'recruitmentemployment',
  29. name: 'RecruitmentEmploymentIndex',
  30. component: () =>
  31. import(
  32. '@/views/RecruitmentEmployment/RecruitmentEmploymentIndex.vue'
  33. ),
  34. meta: {
  35. title: '招聘就业'
  36. }
  37. },
  38. {
  39. path: 'cooperativeenterprise',
  40. name: 'CooperativeEnterpriseIndex',
  41. component: () =>
  42. import(
  43. '@/views/CooperativeEnterprise/CooperativeEnterpriseIndex.vue'
  44. ),
  45. meta: {
  46. title: '合作企业'
  47. }
  48. },
  49. {
  50. path: 'enterprisedetails',
  51. name: 'EnterpriseDetailsIndex',
  52. component: () =>
  53. import(
  54. '@/views/CooperativeEnterprise/EnterpriseDetails/EnterpriseDetailsIndex.vue'
  55. ),
  56. meta: {
  57. title: '企业详情'
  58. }
  59. },
  60. {
  61. path: 'enterprisePosition',
  62. name: 'EnterprisePositionIndex',
  63. component: () =>
  64. import(
  65. '@/views/CooperativeEnterprise/EnterprisePosition/EnterprisePositionIndex.vue'
  66. ),
  67. meta: {
  68. title: '职位详情'
  69. }
  70. },
  71. {
  72. path: 'cooperativecolleges',
  73. name: 'CooperativeCollegesIndex',
  74. component: () =>
  75. import('@/views/CooperativeColleges/CooperativeCollegesIndex.vue'),
  76. meta: {
  77. title: '合作院校'
  78. }
  79. },
  80. {
  81. path: 'collegesdetails',
  82. name: 'CollegesDetailsIndex',
  83. component: () =>
  84. import(
  85. '@/views/CooperativeColleges/CollegesDetails/CollegesDetailsIndex.vue'
  86. ),
  87. meta: {
  88. title: '院校详情'
  89. }
  90. },
  91. {
  92. path: 'skilltraining',
  93. name: 'SkillTrainingIndex',
  94. component: () => import('@/views/SkillTraining/SkillTrainingIndex.vue'),
  95. meta: {
  96. title: '技能培训'
  97. }
  98. },
  99. {
  100. path: 'coursevideo',
  101. name: 'CourseVideoIndex',
  102. component: () => import('@/views/SkillTraining/CourseVideo/CourseVideoIndex.vue'),
  103. meta: {
  104. title: '课程详情'
  105. }
  106. },
  107. {
  108. path: 'workguide',
  109. name: 'WorkGuideIndex',
  110. component: () => import('@/views/WorkGuide/WorkGuideIndex.vue'),
  111. meta: {
  112. title: '创业指引'
  113. }
  114. },
  115. {
  116. path: 'workguide/details',
  117. name: 'WorkGuideDetailsIndex',
  118. component: () => import('@/views/WorkGuide/WorkGuideDetails/WorkGuideDetailsIndex.vue'),
  119. meta: {
  120. title: '创业计划详情'
  121. }
  122. },
  123. {
  124. path: 'educationpromote',
  125. name: 'EducationPromoteIndex',
  126. component: () =>
  127. import('@/views/EducationPromote/EducationPromoteIndex.vue'),
  128. meta: {
  129. title: '学历提升'
  130. }
  131. },
  132. {
  133. path: 'adaptivetraining',
  134. name: 'AdaptiveTrainingIndex',
  135. component: () =>
  136. import('@/views/AdaptiveTraining/AdaptiveTrainingIndex.vue'),
  137. meta: {
  138. title: '适应性培训'
  139. }
  140. },
  141. {
  142. path: 'adaptivetraining/onlinecoursedetails',
  143. name: 'OnlineCourseDetailsIndex',
  144. component: () =>
  145. import('@/views/AdaptiveTraining/OnlineCourseDetails/OnlineCourseDetailsIndex.vue'),
  146. meta: {
  147. title: '线上课程详情'
  148. }
  149. },
  150. {
  151. path: 'adaptivetraining/offlinecoursedetails',
  152. name: 'OfflineCourseDetailsIndex',
  153. component: () =>
  154. import('@/views/AdaptiveTraining/OfflineCourseDetails/OfflineCourseDetailsIndex.vue'),
  155. meta: {
  156. title: '线下课程详情'
  157. }
  158. },
  159. {
  160. path: 'personalcenter',
  161. name: 'PersonalCenterIndex',
  162. component: () =>
  163. import('@/views/PersonalCenter/PersonalCenterIndex.vue'),
  164. meta: {
  165. title: '我的'
  166. }
  167. },
  168. {
  169. path: 'personalcenter/setting',
  170. name: 'SettingIndex',
  171. component: () =>
  172. import('@/views/PersonalCenter/Setting/SettingIndex.vue'),
  173. meta: {
  174. title: '设置'
  175. }
  176. },
  177. {
  178. path: 'personalcenter/resume',
  179. name: 'ResumeIndex',
  180. component: () =>
  181. import('@/views/PersonalCenter/Resume/ResumeIndex.vue'),
  182. meta: {
  183. title: '我的简历'
  184. }
  185. },
  186. {
  187. path: 'personalcenter/resumeEdit',
  188. name: 'ResumeEdit',
  189. component: () =>
  190. import('@/views/PersonalCenter/Resume/ResumeEdit.vue'),
  191. meta: {
  192. title: '编辑简历'
  193. }
  194. },
  195. {
  196. path: 'personalcenter/deliver',
  197. name: 'DeliverIndex',
  198. component: () =>
  199. import('@/views/PersonalCenter/Deliver/DeliverIndex.vue'),
  200. meta: {
  201. title: '我的投递'
  202. }
  203. },
  204. {
  205. path: 'personalcenter/interview',
  206. name: 'InterviewIndex',
  207. component: () =>
  208. import('@/views/PersonalCenter/Interview/InterviewIndex.vue'),
  209. meta: {
  210. title: '我的面试'
  211. }
  212. },
  213. {
  214. path: 'personalcenter/evaluate',
  215. name: 'EvaluateIndex',
  216. component: () =>
  217. import('@/views/PersonalCenter/Evaluate/EvaluateIndex.vue'),
  218. meta: {
  219. title: '我的评价'
  220. }
  221. },
  222. {
  223. path: 'personalcenter/skilltraining',
  224. name: 'SkillTrainingIndex',
  225. component: () =>
  226. import('@/views/PersonalCenter/SkillTraining/SkillTrainingIndex.vue'),
  227. meta: {
  228. title: '我的技能培训'
  229. }
  230. },
  231. {
  232. path: 'personalcenter/skillsTrainingDetails',
  233. name: 'SkillsTrainingDetails',
  234. component: () =>
  235. import('@/views/PersonalCenter/SkillTraining/SkillsTrainingDetails.vue'),
  236. meta: {
  237. title: '我的技能培训-详情'
  238. }
  239. },
  240. {
  241. path: 'personalcenter/progresspoints',
  242. name: 'ProgressPointsIndex',
  243. component: () =>
  244. import('@/views/PersonalCenter/ProgressPoints/ProgressPointsIndex.vue'),
  245. meta: {
  246. title: '进步积分'
  247. }
  248. },
  249. {
  250. path: 'applyeducationauth',
  251. name: 'ApplyEducationAuthIndex',
  252. component: () =>
  253. import('@/views/PersonalCenter/ApplyEducationAuth/ApplyEducationAuthIndex.vue'),
  254. meta: {
  255. title: '退役军人认证'
  256. }
  257. },
  258. {
  259. path: 'newscenter',
  260. name: 'NewsCenterIndex',
  261. component: () =>
  262. import('@/views/NewsCenter/NewsCenterIndex.vue'),
  263. meta: {
  264. title: '新闻中心'
  265. }
  266. },
  267. {
  268. path: 'newsdetails',
  269. name: 'NewsDetailsIndex',
  270. component: () =>
  271. import('@/views/NewsCenter/NewsDetails/NewsDetailsIndex.vue'),
  272. meta: {
  273. title: '新闻详情'
  274. }
  275. },
  276. {
  277. path: 'noticedetails',
  278. name: 'NoticeDetailsIndex',
  279. component: () =>
  280. import('@/views/NewsCenter/NoticeDetails/NoticeDetailsIndex.vue'),
  281. meta: {
  282. title: '通知详情'
  283. }
  284. }
  285. ]
  286. },
  287. {
  288. path: '/login',
  289. name: 'Login',
  290. component: () => import('@/views/Login/LoginIndex.vue'),
  291. meta: {
  292. title: '登录'
  293. }
  294. }
  295. ]
  296. const router = new VueRouter({
  297. mode: 'history',
  298. routes
  299. })
  300. router.beforeEach((to, from, next) => {
  301. /* 路由发生变化修改页面title */
  302. if (to.meta.title) {
  303. document.title = to.meta.title
  304. }
  305. if (store.state.user.token && !store.state.user.isLogin) {
  306. store.dispatch('GetUserInfo')
  307. }
  308. next()
  309. })
  310. export default router