123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314 |
- import Vue from 'vue'
- import VueRouter from 'vue-router'
- import Layout from '@/layout'
- import store from '@/store'
- Vue.use(VueRouter)
- const routes = [
- {
- path: '/',
- component: Layout,
- children: [
- {
- path: '',
- name: 'Index',
- component: () => import('@/views/Home/HomeIndex.vue'),
- meta: {
- title: '首页'
- }
- },
- {
- path: 'policyadvice',
- name: 'PolicyAdvice',
- component: () => import('@/views/PolicyAdvice/PolicyAdviceIndex.vue'),
- meta: {
- title: '政策咨询'
- }
- },
- {
- path: 'recruitmentemployment',
- name: 'RecruitmentEmploymentIndex',
- component: () =>
- import(
- '@/views/RecruitmentEmployment/RecruitmentEmploymentIndex.vue'
- ),
- meta: {
- title: '招聘就业'
- }
- },
- {
- path: 'cooperativeenterprise',
- name: 'CooperativeEnterpriseIndex',
- component: () =>
- import(
- '@/views/CooperativeEnterprise/CooperativeEnterpriseIndex.vue'
- ),
- meta: {
- title: '合作企业'
- }
- },
- {
- path: 'enterprisedetails',
- name: 'EnterpriseDetailsIndex',
- component: () =>
- import(
- '@/views/CooperativeEnterprise/EnterpriseDetails/EnterpriseDetailsIndex.vue'
- ),
- meta: {
- title: '企业详情'
- }
- },
- {
- path: 'enterprisePosition',
- name: 'EnterprisePositionIndex',
- component: () =>
- import(
- '@/views/CooperativeEnterprise/EnterprisePosition/EnterprisePositionIndex.vue'
- ),
- meta: {
- title: '职位详情'
- }
- },
- {
- path: 'cooperativecolleges',
- name: 'CooperativeCollegesIndex',
- component: () =>
- import('@/views/CooperativeColleges/CooperativeCollegesIndex.vue'),
- meta: {
- title: '合作院校'
- }
- },
- {
- path: 'collegesdetails',
- name: 'CollegesDetailsIndex',
- component: () =>
- import(
- '@/views/CooperativeColleges/CollegesDetails/CollegesDetailsIndex.vue'
- ),
- meta: {
- title: '院校详情'
- }
- },
- {
- path: 'skilltraining',
- name: 'SkillTrainingIndex',
- component: () => import('@/views/SkillTraining/SkillTrainingIndex.vue'),
- meta: {
- title: '技能培训'
- }
- },
- {
- path: 'coursevideo',
- name: 'CourseVideoIndex',
- component: () => import('@/views/SkillTraining/CourseVideo/CourseVideoIndex.vue'),
- meta: {
- title: '课程详情'
- }
- },
- {
- path: 'workguide',
- name: 'WorkGuideIndex',
- component: () => import('@/views/WorkGuide/WorkGuideIndex.vue'),
- meta: {
- title: '创业指引'
- }
- },
- {
- path: 'workguide/details',
- name: 'WorkGuideDetailsIndex',
- component: () => import('@/views/WorkGuide/WorkGuideDetails/WorkGuideDetailsIndex.vue'),
- meta: {
- title: '创业计划详情'
- }
- },
- {
- path: 'educationpromote',
- name: 'EducationPromoteIndex',
- component: () =>
- import('@/views/EducationPromote/EducationPromoteIndex.vue'),
- meta: {
- title: '学历提升'
- }
- },
- {
- path: 'adaptivetraining',
- name: 'AdaptiveTrainingIndex',
- component: () =>
- import('@/views/AdaptiveTraining/AdaptiveTrainingIndex.vue'),
- meta: {
- title: '适应性培训'
- }
- },
- {
- path: 'adaptivetraining/onlinecoursedetails',
- name: 'OnlineCourseDetailsIndex',
- component: () =>
- import('@/views/AdaptiveTraining/OnlineCourseDetails/OnlineCourseDetailsIndex.vue'),
- meta: {
- title: '线上课程详情'
- }
- },
- {
- path: 'adaptivetraining/offlinecoursedetails',
- name: 'OfflineCourseDetailsIndex',
- component: () =>
- import('@/views/AdaptiveTraining/OfflineCourseDetails/OfflineCourseDetailsIndex.vue'),
- meta: {
- title: '线下课程详情'
- }
- },
- {
- path: 'personalcenter',
- name: 'PersonalCenterIndex',
- component: () =>
- import('@/views/PersonalCenter/PersonalCenterIndex.vue'),
- meta: {
- title: '我的'
- }
- },
- {
- path: 'personalcenter/setting',
- name: 'SettingIndex',
- component: () =>
- import('@/views/PersonalCenter/Setting/SettingIndex.vue'),
- meta: {
- title: '设置'
- }
- },
- {
- path: 'personalcenter/resume',
- name: 'ResumeIndex',
- component: () =>
- import('@/views/PersonalCenter/Resume/ResumeIndex.vue'),
- meta: {
- title: '我的简历'
- }
- },
- {
- path: 'personalcenter/resumeEdit',
- name: 'ResumeEdit',
- component: () =>
- import('@/views/PersonalCenter/Resume/ResumeEdit.vue'),
- meta: {
- title: '编辑简历'
- }
- },
- {
- path: 'personalcenter/deliver',
- name: 'DeliverIndex',
- component: () =>
- import('@/views/PersonalCenter/Deliver/DeliverIndex.vue'),
- meta: {
- title: '我的投递'
- }
- },
- {
- path: 'personalcenter/interview',
- name: 'InterviewIndex',
- component: () =>
- import('@/views/PersonalCenter/Interview/InterviewIndex.vue'),
- meta: {
- title: '我的面试'
- }
- },
- {
- path: 'personalcenter/evaluate',
- name: 'EvaluateIndex',
- component: () =>
- import('@/views/PersonalCenter/Evaluate/EvaluateIndex.vue'),
- meta: {
- title: '我的评价'
- }
- },
- {
- path: 'personalcenter/skilltraining',
- name: 'SkillTrainingIndex',
- component: () =>
- import('@/views/PersonalCenter/SkillTraining/SkillTrainingIndex.vue'),
- meta: {
- title: '我的技能培训'
- }
- },
- {
- path: 'personalcenter/skillsTrainingDetails',
- name: 'SkillsTrainingDetails',
- component: () =>
- import('@/views/PersonalCenter/SkillTraining/SkillsTrainingDetails.vue'),
- meta: {
- title: '我的技能培训-详情'
- }
- },
- {
- path: 'personalcenter/progresspoints',
- name: 'ProgressPointsIndex',
- component: () =>
- import('@/views/PersonalCenter/ProgressPoints/ProgressPointsIndex.vue'),
- meta: {
- title: '进步积分'
- }
- },
- {
- path: 'applyeducationauth',
- name: 'ApplyEducationAuthIndex',
- component: () =>
- import('@/views/PersonalCenter/ApplyEducationAuth/ApplyEducationAuthIndex.vue'),
- meta: {
- title: '退役军人认证'
- }
- },
- {
- path: 'newscenter',
- name: 'NewsCenterIndex',
- component: () =>
- import('@/views/NewsCenter/NewsCenterIndex.vue'),
- meta: {
- title: '新闻中心'
- }
- },
- {
- path: 'newsdetails',
- name: 'NewsDetailsIndex',
- component: () =>
- import('@/views/NewsCenter/NewsDetails/NewsDetailsIndex.vue'),
- meta: {
- title: '新闻详情'
- }
- },
- {
- path: 'noticedetails',
- name: 'NoticeDetailsIndex',
- component: () =>
- import('@/views/NewsCenter/NoticeDetails/NoticeDetailsIndex.vue'),
- meta: {
- title: '通知详情'
- }
- }
- ]
- },
- {
- path: '/login',
- name: 'Login',
- component: () => import('@/views/Login/LoginIndex.vue'),
- meta: {
- title: '登录'
- }
- }
- ]
- const router = new VueRouter({
- mode: 'history',
- routes
- })
- router.beforeEach((to, from, next) => {
- /* 路由发生变化修改页面title */
- if (to.meta.title) {
- document.title = to.meta.title
- }
- if (store.state.user.token && !store.state.user.isLogin) {
- store.dispatch('GetUserInfo')
- }
- next()
- })
- export default router
|