123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252 |
- import Vue from 'vue';
- import Router from 'vue-router';
- import { getAuth } from '@/utils/auth';
- import { getGuide } from '@/utils/guide';
- import {
- getTenantCode, getSystemConfig,
- getUserIcon, shitiStatusControl,
- saveHistoryPaths,
- } from '@/utils/common';
- Vue.use(Router);
- const originalPush = Router.prototype.push
- Router.prototype.push = function push (location) {
- return originalPush.call(this, location).catch(err => err)
- };
- const router = new Router({
- mode: 'history',
- base: process.env.BASE_URL,
- routes: [
- {
- path: '/',
- redirect: '/c/index',
- },
- {
- name: 'Login',
- path: '/login',
- component: () => {
- return import(/* webpackChunkName: "Login" */ './views/management/Login/index.vue');
- },
- },
- {
- path:'/c/',
- component: () => import(/* webpackChunkName: "Cframe" */ './components/client/common/Cframe.vue'),
- children: [
- {
- name: 'index',
- path: 'index',
- component: () => {
- return import(/* webpackChunkName: "index" */ './views/client/Index.vue');
- },
- },
- {
- name: 'examsystem',
- path: 'examsystem',
- meta: {
- parentPath: 'croot',
- breadcrumb: {
- display: '考试平台',
- },
- },
- component: () => {
- return import(/* webpackChunkName: "examsystem" */ './views/client/examsystem.vue');
- },
- },
- {
- name: 'trainsystem',
- path: 'trainsystem',
- meta: {
- parentPath: 'croot',
- breadcrumb: {
- display: '培训平台',
- },
- },
- component: () => {
- return import(/* webpackChunkName: "trainsystem" */ './views/client/trainsystem.vue');
- },
- },
- {
- name: 'courseDev',
- path: 'courseDev',
- meta: {
- parentPath: 'croot',
- breadcrumb: {
- display: '课程列表',
- },
- },
- component: () => {
- return import(/* webpackChunkName: "incourseDevdex" */ './views/client/CourseDev.vue');
- },
- },
- {
- name: 'newsInfor',
- path: 'newsInfor',
- meta: {
- parentPath: 'croot',
- breadcrumb: {
- display: '新闻资讯',
- },
- },
- component: () => {
- return import(/* webpackChunkName: "newsInfor" */ './views/client/newsInfor.vue');
- },
- },
- {
- name: 'helpCenter',
- path: 'helpCenter',
- meta: {
- parentPath: 'croot',
- breadcrumb: {
- display: '帮助中心',
- },
- },
- component: () => {
- return import(/* webpackChunkName: "helpCenter" */ './views/client/helpCenter.vue');
- },
- },
- {
- name: 'aboutUs',
- path: 'aboutUs',
- meta: {
- parentPath: 'croot',
- breadcrumb: {
- display: '关于我们',
- },
- },
- component: () => {
- return import(/* webpackChunkName: "aboutUs" */ './views/client/aboutUs.vue');
- },
- },
- {
- path: 'newsInforDetails',
- name: 'newsInforDetails',
- meta: {
- parentPath: 'croot',
- breadcrumb: {
- display: '行业详情',
- },
- },
- component: () => {
- return import(/* webpackChunkName: "newsInforDetails" */ './views/client/newsInforDetails.vue');
- },
- },
- ],
- },
- {
- name: 'admin',
- path: '/admin',
- meta: {
- icon: "el-icon-platform-eleme",
- title: "页面管理"
- },
- isAdminMenu: true,
- component: () => {
- return import(/* webpackChunkName: "admin" */ './views/management/Home/index.vue');
- },
- children: [
- {
- path: '/newsClassify',
- name: 'newsClassify',
- meta: {
- icon: "",
- title: "新闻分类"
- },
- isAdminMenu: true,
- component: () => {
- return import(/* webpackChunkName: "newsClassify" */ './views/management/XinWenFenLei/index.vue');
- },
- },
- {
- path: '/news',
- name: 'news',
- meta: {
- icon: "",
- title: "新闻资讯"
- },
- isAdminMenu: true,
- component: () => {
- return import(/* webpackChunkName: "news" */ './views/management/XingWenZiXun/index.vue');
- },
- },
- {
- path: '/news/config',
- name: 'newsConfig',
- component: () => {
- return import(/* webpackChunkName: "newsConfig" */ './views/management/XingWenZiXun/XinWenZiXunConfig/index.vue');
- },
- },
- {
- path: '/blogroll',
- name: 'blogroll',
- meta: {
- icon: "",
- title: "友情链接"
- },
- isAdminMenu: true,
- component: () => {
- return import(/* webpackChunkName: "blogroll" */ './views/management/YouQingLianJie/index.vue');
- },
- },
- {
- path: '/Advertising',
- name: 'advertising',
- meta: {
- icon: "",
- title: "横幅广告"
- },
- isAdminMenu: true,
- component: () => {
- return import(/* webpackChunkName: "Advertising" */ './views/management/Advertising/index.vue');
- },
- },
- {
- path: '/register',
- name: 'register',
- meta: {
- icon: "",
- title: "注册审核"
- },
- isAdminMenu: true,
- component: () => {
- return import(/* webpackChunkName: "register" */ './views/management/RegistrationManagement/index.vue');
- },
- },
- {
- path: '/weikezhizuo',
- name: 'weikezhizuo',
- meta: {
- icon: "",
- title: "微课制作"
- },
- isAdminMenu: false,
- component: () => {
- return import(/* webpackChunkName: "news" */ './views/management/weikezhizuo/index.vue');
- },
- },
- {
- path: '/think',
- name: 'think',
- meta: {
- icon: "",
- title: "think"
- },
- isAdminMenu: false,
- component: () => {
- return import(/* webpackChunkName: "register" */ './views/think/youqinglianjie/index.vue');
- },
- },
- ],
- },
- ],
- });
- router.beforeEach((to, from, next) => {
- // FIXME 标题 待确认
- document.title = to.meta.title ? '麦塔': '麦塔';
- next();
- });
- export default router;
|