index.js 15.9 KB
Newer Older
qzhxx's avatar
qzhxx committed
1 2 3 4 5 6
import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router);

///首页
xulili's avatar
xulili committed
7
const indexPage = r => require.ensure([], () => r(require('@/page/end/indexPage')), 'indexPage');
qzhxx's avatar
qzhxx committed
8 9

// 呼叫记录
xulili's avatar
xulili committed
10
const callHistory = r => require.ensure([], () => r(require('@/page/end/callHistory')), 'callHistory');
qzhxx's avatar
qzhxx committed
11
///意见建议及反馈
xulili's avatar
xulili committed
12 13
const feedbackPage = r => require.ensure([], () => r(require('@/page/end/feedbackPage')), 'feedbackPage');
const hallDirectorPage = r => require.ensure([], () => r(require('@/page/end/hallDirectorPage')), 'hallDirectorPage');
qzhxx's avatar
qzhxx committed
14

xulili's avatar
xulili committed
15 16 17
const page403 = r => require.ensure([], () => r(require('@/page/errorPage/page403')), 'page403');
const page404 = r => require.ensure([], () => r(require('@/page/errorPage/page404')), 'page404');
const page500 = r => require.ensure([], () => r(require('@/page/errorPage/page500')), 'page500');
qzhxx's avatar
qzhxx committed
18 19 20

/*内容管理*/
// 业务服务指南
xulili's avatar
xulili committed
21
const serviceGuidePage = r => require.ensure([], () => r(require('@/page/end/serviceGuidePage')), 'serviceGuidePage');
qzhxx's avatar
qzhxx committed
22
// 网点服务地图
xulili's avatar
xulili committed
23
const serviceDirectoryPage = r => require.ensure([], () => r(require('@/page/end/serviceDirectoryPage')), 'serviceDirectoryPage');
qzhxx's avatar
qzhxx committed
24
// 热门产品
xulili's avatar
xulili committed
25
const hotProductsPage = r => require.ensure([], () => r(require('@/page/end/hotProductsPage')), 'hotProductsPage');
qzhxx's avatar
qzhxx committed
26
//热门活动
xulili's avatar
xulili committed
27
const popularActivitiesPage = r => require.ensure([], () => r(require('@/page/end/popularActivitiesPage')), 'popularActivitiesPage');
qzhxx's avatar
qzhxx committed
28 29

// 系统管理
xulili's avatar
xulili committed
30 31 32 33
const userManagePage = r => require.ensure([], () => r(require('@/page/end/userManagePage')), 'userManagePage');
const roleManagePage = r => require.ensure([], () => r(require('@/page/end/roleManagePage')), 'roleManagePage');
const branchesManagePage = r => require.ensure([], () => r(require('@/page/end/branchesManagePage')), 'branchesManagePage');
const permissionsManagePage = r => require.ensure([], () => r(require('@/page/end/permissionsManagePage')), 'permissionsManagePage');
qzhxx's avatar
qzhxx committed
34
//菜单管理
xulili's avatar
xulili committed
35 36
const menuManagePage = r => require.ensure([], () => r(require('@/page/end/menuManagePage')), 'menuManagePage');
const analysisPage = r => require.ensure([], () => r(require('@/page/end/analysisPage')), 'analysisPage');
qzhxx's avatar
qzhxx committed
37
///预约记录
xulili's avatar
xulili committed
38 39
const hotProductsRecord = r => require.ensure([], () => r(require('@/page/end/hotProductsRecord')), 'hotProductsRecord');
const popularActiveRecord = r => require.ensure([], () => r(require('@/page/end/popularActiveRecord')), 'popularActiveRecord');
qzhxx's avatar
qzhxx committed
40

qzhxx's avatar
qzhxx committed
41
// 内容管理
xulili's avatar
xulili committed
42 43 44
const videoCopyright = r => require.ensure([], () => r(require('@/page/content/video/copyright/index')), 'videoCopyright');
const videoCopyrightAdd = r => require.ensure([], () => r(require('@/page/content/video/copyright/add')), 'videoCopyrightAdd');
const videoCopyrightUpdate = r => require.ensure([], () => r(require('@/page/content/video/copyright/add')), 'videoCopyrightUpdate');
qzhxx's avatar
qzhxx committed
45

xulili's avatar
xulili committed
46 47 48
const videoContent = r => require.ensure([], () => r(require('@/page/content/video/content/index')), 'videoContent');
const videoContentAdd = r => require.ensure([], () => r(require('@/page/content/video/content/add')), 'videoContentAdd');
const videoContentUpdate = r => require.ensure([], () => r(require('@/page/content/video/content/add')), 'videoContentUpdate');
qzhxx's avatar
qzhxx committed
49

qzhxx's avatar
qzhxx committed
50 51
/*跳转的页面*/
// 新建服务指南
xulili's avatar
xulili committed
52
const newServiceGuide = r => require.ensure([], () => r(require('@/page/routerPage/newServiceGuide')), 'newServiceGuide');
qzhxx's avatar
qzhxx committed
53
// 新建网络服务地图
xulili's avatar
xulili committed
54
const newDirectory = r => require.ensure([], () => r(require('@/page/routerPage/newDirectory')), 'newDirectory');
qzhxx's avatar
qzhxx committed
55 56 57


// 新建网络服务地图
xulili's avatar
xulili committed
58
const hotSpotManage = r => require.ensure([], () => r(require('@/page/routerPage/hotSpotManage')), 'hotSpotManage');
qzhxx's avatar
qzhxx committed
59 60

// 新增热门服务
xulili's avatar
xulili committed
61
const newHotPro = r => require.ensure([], () => r(require('@/page/routerPage/newHotPro')), 'newHotPro');
qzhxx's avatar
qzhxx committed
62
// 新增业务
xulili's avatar
xulili committed
63
const newPopActivity = r => require.ensure([], () => r(require('@/page/routerPage/newPopActivity')), 'newPopActivity');
qzhxx's avatar
qzhxx committed
64
//审核 auditMsg  auditMap auditProductActivity
xulili's avatar
xulili committed
65 66 67
const auditMsg = r => require.ensure([], () => r(require('@/page/routerPage/auditMsg')), 'auditMsg');
const auditMap = r => require.ensure([], () => r(require('@/page/routerPage/auditMap')), 'auditMap');
const auditProductActivity = r => require.ensure([], () => r(require('@/page/routerPage/auditProductActivity')), 'auditProductActivity');
qzhxx's avatar
qzhxx committed
68 69 70


//管理
xulili's avatar
xulili committed
71
const menuRouter = r => require.ensure([], () => r(require('@/page/end/menuRouter')), 'menuRouter');
qzhxx's avatar
qzhxx committed
72
// 登录
xulili's avatar
xulili committed
73
const login = r => require.ensure([], () => r(require('@/components/end/login')), 'login');
qzhxx's avatar
qzhxx committed
74
// 忘记密码
xulili's avatar
xulili committed
75
const forgetPassword = r => require.ensure([], () => r(require('@/components/end/forgetPassword')), 'forgetPassword');
xulili's avatar
xulili committed
76
// 首页
xulili's avatar
xulili committed
77 78 79
import { statisticsRoute } from './statistics'
import { systemRoute } from './system'
import { accoutsRoute } from './accout'
80
import { STBoxRoute } from './STBox'
qzhxx's avatar
qzhxx committed
81 82
const router = new Router({
  routes: [
xulili's avatar
xulili committed
83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113
    {
      path: '/',
      redirect:'/login'
    },
    {
      path: '/login',
      name: '登录',
      component: login,
      meta:{
        noShowbar:true
      }
    },
    {
      path: '/index',
      name: '首页',
      component: () => import('@/page/index/index'),
      meta: {
        isRequireLogin: true,
        showBreadcrumb: false
      }
    },
    ...statisticsRoute,
    ...systemRoute,
    ...accoutsRoute,
    ...STBoxRoute,
    {
      path: '/forgetPassword',
      name: '忘记密码',
      component: forgetPassword
    },
    {
qzhxx's avatar
qzhxx committed
114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220
      path: '/menuRouter',
      component: menuRouter,
      meta: {
        requireBackLogin: true
      },
      children: [
        {
          path: '/indexPage',
          name: '首页',
          component: indexPage
        },
        {
          path: '/callHistory',
          name: '呼叫记录 ',
          component: callHistory
        },
        {
          path: '/feedbackPage',
          name: '意见建议及反馈',
          component: feedbackPage
        },
        {
          path: '/hallDirectorPage',
          name: '支行人员管理',
          component: hallDirectorPage
        },
        {
          path: '/page403',
          name: '报错页面',
          component: page403
        },
        {
          path: '/page404',
          name: '报错页面',
          component: page404
        },
        {
          path: '/page500',
          name: '报错页面',
          component: page500
        },

        //内容管理
        {
          path: '/serviceGuidePage',
          name: '业务服务指南',
          component: serviceGuidePage
        },
        {
          path: '/serviceDirectoryPage',
          name: '网点服务地图',
          component: serviceDirectoryPage
        },
        {
          path: '/hotProductsPage',
          name: '热门产品',
          component: hotProductsPage
        },
        {
          path: '/popularActivitiesPage',
          name: '热门活动',
          component: popularActivitiesPage
        },

        //系统管理
        {
          path: '/userManagePage',
          name: '用户管理',
          component: userManagePage
        },
        {
          path: '/roleManagePage',
          name: '角色管理',
          component: roleManagePage
        },
        {
          path: '/branchesManagePage',
          name: '网点管理',
          component: branchesManagePage
        },
        {
          path: '/permissionsManagePage',
          name: '权限管理',
          component: permissionsManagePage
        },
        {
          path: '/menuManagePage',
          name: '菜单管理',
          component: menuManagePage
        },
        {
          path: '/analysisPage',
          name: '分析管理',
          component: analysisPage
        },
        //预约记录
        {
          path: '/hotProductsRecord',
          name: '热门产品',
          component: hotProductsRecord
        },
        {
          path: '/popularActiveRecord',
          name: '热门活动',
          component: popularActiveRecord
        },

qzhxx's avatar
qzhxx committed
221
        // --- 国博内容管理
qzhxx's avatar
qzhxx committed
222 223 224
        {
          path: '/videoCopyrightAdd',
          name: '新建版权方',
qzhxx's avatar
qzhxx committed
225
          component: videoCopyrightAdd,
xulili's avatar
xulili committed
226 227 228
          meta: {
            showBreadcrumb: true,
            title: '新建版权方',
qzhxx's avatar
qzhxx committed
229
          }
qzhxx's avatar
qzhxx committed
230 231 232 233
        },
        {
          path: '/videoCopyrightUpdate',
          name: '修改版权方',
qzhxx's avatar
qzhxx committed
234
          component: videoCopyrightUpdate,
xulili's avatar
xulili committed
235 236 237
          meta: {
            showBreadcrumb: true,
            title: '修改版权方',
qzhxx's avatar
qzhxx committed
238
          }
qzhxx's avatar
qzhxx committed
239 240
        },

qzhxx's avatar
qzhxx committed
241 242 243 244 245
        // {
        //   path: '/videoContent',
        //   name: '视频内容管理',
        //   component: videoContent
        // },
qzhxx's avatar
qzhxx committed
246 247 248
        {
          path: '/videoContentAdd',
          name: '新建视频',
qzhxx's avatar
qzhxx committed
249
          component: videoContentAdd,
xulili's avatar
xulili committed
250 251 252
          meta: {
            showBreadcrumb: true,
            title: '新建视频',
qzhxx's avatar
qzhxx committed
253
          }
qzhxx's avatar
qzhxx committed
254 255 256 257
        },
        {
          path: '/videoContentUpdate',
          name: '修改视频',
qzhxx's avatar
qzhxx committed
258
          component: videoContentUpdate,
xulili's avatar
xulili committed
259 260 261
          meta: {
            showBreadcrumb: true,
            title: '修改视频',
qzhxx's avatar
qzhxx committed
262 263 264 265 266 267
          }
        },
        {
          path: '/videoCopyright',
          name: '视频版权方管理',
          component: () => import('@/page/content/video/copyright/index'),
xulili's avatar
xulili committed
268 269 270
          meta: {
            showBreadcrumb: true,
            title: '视频版权方管理',
qzhxx's avatar
qzhxx committed
271 272 273 274 275 276
          }
        },
        {
          path: '/videoClassify',
          name: '视频分类管理',
          component: () => import('@/page/content/video/classify/index'),
xulili's avatar
xulili committed
277 278 279
          meta: {
            showBreadcrumb: true,
            title: '视频分类管理',
qzhxx's avatar
qzhxx committed
280 281 282 283 284 285
          }
        },
        {
          path: '/videoContent',
          name: '视频内容管理',
          component: () => import('@/page/content/video/content/index'),
xulili's avatar
xulili committed
286 287 288
          meta: {
            showBreadcrumb: true,
            title: '视频内容管理',
qzhxx's avatar
qzhxx committed
289 290 291 292 293 294
          }
        },
        {
          path: '/videoRemit',
          name: '视频汇出',
          component: () => import('@/page/content/video/remit/index'),
xulili's avatar
xulili committed
295 296 297
          meta: {
            showBreadcrumb: true,
            title: '视频汇出',
qzhxx's avatar
qzhxx committed
298
          }
qzhxx's avatar
qzhxx committed
299
        },
qzhxx's avatar
qzhxx committed
300

qzhxx's avatar
qzhxx committed
301 302 303 304 305
        // --- 展板
        {
          path: '/displayCopyright',
          name: '展板版权方管理',
          component: () => import('@/page/content/display/copyright/index'),
xulili's avatar
xulili committed
306 307 308
          meta: {
            showBreadcrumb: true,
            title: '展板版权方管理',
qzhxx's avatar
qzhxx committed
309 310
          }
        },
311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328
        {
          path: '/displayCopyrightAdd',
          name: '新建展板版权方',
          component: () => import('@/page/content/display/copyright/Add'),
          meta: {
            showBreadcrumb: true,
            title: '新建展板版权方',
          }
        },
        {
          path: '/displayCopyrightUpdate',
          name: '修改展板版权方',
          component: () => import('@/page/content/display/copyright/Add'),
          meta: {
            showBreadcrumb: true,
            title: '修改展板版权方',
          }
        },
qzhxx's avatar
qzhxx committed
329 330 331 332
        {
          path: '/displayClassify',
          name: '展板分类管理',
          component: () => import('@/page/content/display/classify/index'),
xulili's avatar
xulili committed
333 334 335
          meta: {
            showBreadcrumb: true,
            title: '展板分类管理',
qzhxx's avatar
qzhxx committed
336 337 338 339 340 341
          }
        },
        {
          path: '/displayContent',
          name: '展板内容管理',
          component: () => import('@/page/content/display/content/index'),
xulili's avatar
xulili committed
342 343 344
          meta: {
            showBreadcrumb: true,
            title: '展板内容管理',
qzhxx's avatar
qzhxx committed
345 346 347 348 349 350
          }
        },
        {
          path: '/displayContentAdd',
          name: '新建展板',
          component: () => import('@/page/content/display/content/add'),
xulili's avatar
xulili committed
351 352 353
          meta: {
            showBreadcrumb: true,
            title: '新建展板',
qzhxx's avatar
qzhxx committed
354 355 356 357 358 359
          }
        },
        {
          path: '/displayContentUpdate',
          name: '修改展板',
          component: () => import('@/page/content/display/content/add'),
xulili's avatar
xulili committed
360 361 362
          meta: {
            showBreadcrumb: true,
            title: '修改展板',
qzhxx's avatar
qzhxx committed
363 364 365 366 367 368
          }
        },
        {
          path: '/displayContentDetails',
          name: '展板管理详情',
          component: () => import('@/page/content/display/content/details'),
xulili's avatar
xulili committed
369 370 371
          meta: {
            showBreadcrumb: true,
            title: '展板管理详情',
qzhxx's avatar
qzhxx committed
372 373 374 375
          }
        },
        // --学习
        {
qzhxx's avatar
qzhxx committed
376
          path: '/learnProject',
xulili's avatar
xulili committed
377
          name: '学习项目管理',
qzhxx's avatar
qzhxx committed
378
          component: () => import('@/page/content/learn/project/index'),
xulili's avatar
xulili committed
379 380
          meta: {
            showBreadcrumb: true,
xulili's avatar
xulili committed
381
            title: '学习项目管理',
qzhxx's avatar
qzhxx committed
382 383 384 385
          }
        },
        {
          path: '/learnContent',
qzhxx's avatar
qzhxx committed
386
          name: '学习内容制作',
qzhxx's avatar
qzhxx committed
387
          component: () => import('@/page/content/learn/content/index'),
xulili's avatar
xulili committed
388 389 390
          meta: {
            showBreadcrumb: true,
            title: '学习内容制作',
qzhxx's avatar
qzhxx committed
391 392 393
          }
        },
        {
qzhxx's avatar
qzhxx committed
394
          path: '/learnContentAdd',
qzhxx's avatar
qzhxx committed
395
          name: '新建学习内容',
qzhxx's avatar
qzhxx committed
396
          component: () => import('@/page/content/learn/content/add'),
xulili's avatar
xulili committed
397 398 399
          meta: {
            showBreadcrumb: true,
            title: '新建学习内容',
qzhxx's avatar
qzhxx committed
400 401 402
          }
        },
        {
qzhxx's avatar
qzhxx committed
403 404 405
          path: '/learnContentUpdate',
          name: '修改学习内容',
          component: () => import('@/page/content/learn/content/add'),
xulili's avatar
xulili committed
406 407 408
          meta: {
            showBreadcrumb: true,
            title: '修改学习内容',
qzhxx's avatar
qzhxx committed
409 410 411
          }
        },
        {
qzhxx's avatar
qzhxx committed
412 413 414
          path: '/learnContentDetails',
          name: '学习内容详情',
          component: () => import('@/page/content/learn/content/details'),
xulili's avatar
xulili committed
415 416 417
          meta: {
            showBreadcrumb: true,
            title: '学习内容详情',
qzhxx's avatar
qzhxx committed
418 419
          }
        },
xulili's avatar
xulili committed
420

qzhxx's avatar
qzhxx committed
421 422 423 424 425
        // 审核
        {
          path: '/checkVideo',
          name: '视频审核',
          component: () => import('@/page/check/video/index'),
xulili's avatar
xulili committed
426 427 428
          meta: {
            showBreadcrumb: true,
            title: '视频审核',
qzhxx's avatar
qzhxx committed
429 430 431 432 433 434
          }
        },
        {
          path: '/checkDisplay',
          name: '展板审核',
          component: () => import('@/page/check/display/index'),
xulili's avatar
xulili committed
435 436 437
          meta: {
            showBreadcrumb: true,
            title: '展板审核',
qzhxx's avatar
qzhxx committed
438 439
          }
        },
qzhxx's avatar
qzhxx committed
440 441 442 443
        {
          path: '/checkLearn',
          name: '平台学习内容审核',
          component: () => import('@/page/check/learn/index'),
xulili's avatar
xulili committed
444 445 446
          meta: {
            showBreadcrumb: true,
            title: '平台学习内容审核',
qzhxx's avatar
qzhxx committed
447 448 449 450 451 452
          }
        },
        {
          path: '/checkLearnDetails',
          name: '学习内容详情',
          component: () => import('@/page/check/learn/details'),
xulili's avatar
xulili committed
453 454 455
          meta: {
            showBreadcrumb: true,
            title: '学习内容详情',
qzhxx's avatar
qzhxx committed
456 457 458
          }
        },

xulili's avatar
xulili committed
459

qzhxx's avatar
qzhxx committed
460

qzhxx's avatar
qzhxx committed
461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508
        //新建页面
        {
          path: '/newServiceGuide',
          name: '新建业务指南',
          component: newServiceGuide
        },
        {
          path: '/newDirectory',
          name: '新增网点地图',
          component: newDirectory
        },
        {
          path: '/hotSpotManage',
          name: 'hotSpotManage',
          component: hotSpotManage
        },
        {
          path: '/newHotPro',
          name: '新增产品',
          component: newHotPro
        },
        {
          path: '/newPopActivity',
          name: '新增活动',
          component: newPopActivity
        },
        {
          path: '/auditMsg',
          name: '审核业务',
          component: auditMsg
        },
        {
          path: '/auditMap',
          name: '审核地图',
          component: auditMap
        },
        {
          path: '/auditProductActivity',
          name: '审核活动产品',
          component: auditProductActivity
        },
      ]
    },


  ]
})
router.beforeEach((to, from, next) => {
xulili's avatar
xulili committed
509
  if (to.meta.requireBackLogin) {
qzhxx's avatar
qzhxx committed
510 511 512
    let user = localStorage.getItem("userId");
    if (user) {  // 通过vuex state获取当前的token是否存在
      return next();
xulili's avatar
xulili committed
513
    } else {
qzhxx's avatar
qzhxx committed
514 515
      next({
        path: '/',
xulili's avatar
xulili committed
516
        query: { redirect: to.fullPath },
qzhxx's avatar
qzhxx committed
517 518
      })
    }
xulili's avatar
xulili committed
519
  } else {
qzhxx's avatar
qzhxx committed
520 521 522 523
    next();
  }
})
export default router