index.js 16.3 KB
Newer Older
qzhxx's avatar
qzhxx committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router);

///首页
const indexPage = r => require.ensure([],()=>r(require('@/page/end/indexPage')),'indexPage');

// 呼叫记录
const callHistory = r => require.ensure([],()=>r(require('@/page/end/callHistory')),'callHistory');
///意见建议及反馈
const feedbackPage = r => require.ensure([],()=>r(require('@/page/end/feedbackPage')),'feedbackPage');
const hallDirectorPage = r => require.ensure([],()=>r(require('@/page/end/hallDirectorPage')),'hallDirectorPage');

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');

/*内容管理*/
// 业务服务指南
const serviceGuidePage = r => require.ensure([],()=>r(require('@/page/end/serviceGuidePage')),'serviceGuidePage');
// 网点服务地图
const serviceDirectoryPage = r => require.ensure([],()=>r(require('@/page/end/serviceDirectoryPage')),'serviceDirectoryPage');
// 热门产品
const hotProductsPage = r => require.ensure([],()=>r(require('@/page/end/hotProductsPage')),'hotProductsPage');
//热门活动
const popularActivitiesPage = r => require.ensure([],()=>r(require('@/page/end/popularActivitiesPage')),'popularActivitiesPage');

// 系统管理
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');
//菜单管理
const menuManagePage = r => require.ensure([],()=>r(require('@/page/end/menuManagePage')),'menuManagePage');
const analysisPage = r => require.ensure([],()=>r(require('@/page/end/analysisPage')),'analysisPage');
///预约记录
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
41
// 内容管理
qzhxx's avatar
qzhxx committed
42 43 44 45 46 47 48
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');

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 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
/*跳转的页面*/
// 新建服务指南
const newServiceGuide = r => require.ensure([],()=>r(require('@/page/routerPage/newServiceGuide')),'newServiceGuide');
// 新建网络服务地图
const newDirectory = r => require.ensure([],()=>r(require('@/page/routerPage/newDirectory')),'newDirectory');


// 新建网络服务地图
const hotSpotManage = r => require.ensure([],()=>r(require('@/page/routerPage/hotSpotManage')),'hotSpotManage');

// 新增热门服务
const newHotPro = r => require.ensure([],()=>r(require('@/page/routerPage/newHotPro')),'newHotPro');
// 新增业务
const newPopActivity = r => require.ensure([],()=>r(require('@/page/routerPage/newPopActivity')),'newPopActivity');
//审核 auditMsg  auditMap auditProductActivity
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');


//管理
const menuRouter = r => require.ensure([],()=>r(require('@/page/end/menuRouter')),'menuRouter');
// 登录
const login = r => require.ensure([],()=>r(require('@/components/end/login')),'login');
// 忘记密码
const forgetPassword = r => require.ensure([],()=>r(require('@/components/end/forgetPassword')),'forgetPassword');
xulili's avatar
xulili committed
76
// 首页
qzhxx's avatar
qzhxx committed
77 78 79 80 81 82 83 84

const router = new Router({
  routes: [
     {
       path: '/',
       name: '登录',
       component: login
      },
xulili's avatar
xulili committed
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
      {
        path: '/index',
        name: '首页',
        component: () => import('@/page/index/index'),
        meta:{
          isRequireLogin:true,
          showBreadcrumb:false
        }
       },
       {
        path: '/organ',
        name: '机构管理',
        component: () => import('@/page/system/organ'),
        meta:{
          showBreadcrumb:true,
          title:'机构管理',
        }
       },
       {
        path: '/users',
        name: '用户管理',
        component: () => import('@/page/system/users'),
        meta:{
          showBreadcrumb:true,
          title:'用户管理',
        }
       },
xulili's avatar
xulili committed
112 113 114 115 116 117 118 119 120
       {
        path: '/log',
        name: '日志管理',
        component: () => import('@/page/system/log'),
        meta:{
          showBreadcrumb:true,
          title:'日志管理',
        }
       },
xulili's avatar
xulili committed
121 122 123 124 125 126 127 128 129
       {
        path: '/unitAdmin',
        name: '单位管理员账号管理',
        component: () => import('@/page/system/unitAdmin'),
        meta:{
          showBreadcrumb:true,
          title:'单位管理员账号管理',
        }
       },
xulili's avatar
xulili committed
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
       {
        path: '/edition',
        name: 'app版本管理',
        component: () => import('@/page/system/edition'),
        meta:{
          showBreadcrumb:true,
          title:'app版本管理',
        }
       },
       {
        path: '/changePwd',
        name: '修改密码',
        component: () => import('@/page/system/changePwd'),
        meta:{
          showBreadcrumb:true,
          title:'修改密码',
        }
       },
      //  统计管理
       {
        path: '/overview',
        name: '统计概览',
        component: () => import('@/page/statistics/overview'),
        meta:{
          showBreadcrumb:true,
          title:'统计概览',
        }
       },
       {
        path: '/interaction',
        name: '互动统计',
        component: () => import('@/page/statistics/interaction'),
        meta:{
          showBreadcrumb:true,
          title:'互动统计',
        }
       },
        {
          path: '/tend',
          name: '趋势分析',
          component: () => import('@/page/statistics/tend'),
          meta:{
          showBreadcrumb:true,
          title:'趋势分析',
        }
      },      
qzhxx's avatar
qzhxx committed
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 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288
      {
       path: '/forgetPassword',
       name: '忘记密码',
       component: forgetPassword
      },
      {
      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
289
        // --- 国博内容管理
qzhxx's avatar
qzhxx committed
290 291 292
        {
          path: '/videoCopyrightAdd',
          name: '新建版权方',
qzhxx's avatar
qzhxx committed
293 294 295 296 297
          component: videoCopyrightAdd,
          meta:{
            showBreadcrumb:true,
            title:'新建版权方',
          }
qzhxx's avatar
qzhxx committed
298 299 300 301
        },
        {
          path: '/videoCopyrightUpdate',
          name: '修改版权方',
qzhxx's avatar
qzhxx committed
302 303 304 305 306
          component: videoCopyrightUpdate,
          meta:{
            showBreadcrumb:true,
            title:'修改版权方',
          }
qzhxx's avatar
qzhxx committed
307 308
        },

qzhxx's avatar
qzhxx committed
309 310 311 312 313
        // {
        //   path: '/videoContent',
        //   name: '视频内容管理',
        //   component: videoContent
        // },
qzhxx's avatar
qzhxx committed
314 315 316
        {
          path: '/videoContentAdd',
          name: '新建视频',
qzhxx's avatar
qzhxx committed
317 318 319 320 321
          component: videoContentAdd,
          meta:{
            showBreadcrumb:true,
            title:'新建视频',
          }
qzhxx's avatar
qzhxx committed
322 323 324 325
        },
        {
          path: '/videoContentUpdate',
          name: '修改视频',
qzhxx's avatar
qzhxx committed
326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366
          component: videoContentUpdate,
          meta:{
            showBreadcrumb:true,
            title:'修改视频',
          }
        },
        {
          path: '/videoCopyright',
          name: '视频版权方管理',
          component: () => import('@/page/content/video/copyright/index'),
          meta:{
            showBreadcrumb:true,
            title:'视频版权方管理',
          }
        },
        {
          path: '/videoClassify',
          name: '视频分类管理',
          component: () => import('@/page/content/video/classify/index'),
          meta:{
            showBreadcrumb:true,
            title:'视频分类管理',
          }
        },
        {
          path: '/videoContent',
          name: '视频内容管理',
          component: () => import('@/page/content/video/content/index'),
          meta:{
            showBreadcrumb:true,
            title:'视频内容管理',
          }
        },
        {
          path: '/videoRemit',
          name: '视频汇出',
          component: () => import('@/page/content/video/remit/index'),
          meta:{
            showBreadcrumb:true,
            title:'视频汇出',
          }
qzhxx's avatar
qzhxx committed
367
        },
qzhxx's avatar
qzhxx committed
368

qzhxx's avatar
qzhxx committed
369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461
        // --- 展板
        {
          path: '/displayCopyright',
          name: '展板版权方管理',
          component: () => import('@/page/content/display/copyright/index'),
          meta:{
            showBreadcrumb:true,
            title:'展板版权方管理',
          }
        },
        {
          path: '/displayClassify',
          name: '展板分类管理',
          component: () => import('@/page/content/display/classify/index'),
          meta:{
            showBreadcrumb:true,
            title:'展板分类管理',
          }
        },
        {
          path: '/displayContent',
          name: '展板内容管理',
          component: () => import('@/page/content/display/content/index'),
          meta:{
            showBreadcrumb:true,
            title:'展板内容管理',
          }
        },
        {
          path: '/displayContentAdd',
          name: '新建展板',
          component: () => import('@/page/content/display/content/add'),
          meta:{
            showBreadcrumb:true,
            title:'新建展板',
          }
        },
        {
          path: '/displayContentUpdate',
          name: '修改展板',
          component: () => import('@/page/content/display/content/add'),
          meta:{
            showBreadcrumb:true,
            title:'修改展板',
          }
        },
        {
          path: '/displayContentDetails',
          name: '展板管理详情',
          component: () => import('@/page/content/display/content/details'),
          meta:{
            showBreadcrumb:true,
            title:'展板管理详情',
          }
        },
        // --学习
        {
          path: '/learn',
          name: '学习内容制作',
          component: () => import('@/page/content/learn/index'),
          meta:{
            showBreadcrumb:true,
            title:'学习内容制作',
          }
        },
        {
          path: '/learnAdd',
          name: '新建学习内容',
          component: () => import('@/page/content/learn/add'),
          meta:{
            showBreadcrumb:true,
            title:'新建学习内容',
          }
        },
        {
          path: '/learnUpdate',
          name: '修改展板',
          component: () => import('@/page/content/learn/add'),
          meta:{
            showBreadcrumb:true,
            title:'修改展板',
          }
        },
        {
          path: '/learnDetails',
          name: '展板管理详情',
          component: () => import('@/page/content/learn/details'),
          meta:{
            showBreadcrumb:true,
            title:'展板管理详情',
          }
        },

qzhxx's avatar
qzhxx committed
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
        //新建页面
        {
          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
        },
503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524


        //=======================================机顶盒管理 start ===================================//
        {
          path: '/STBbase',
          name: '机顶盒基础信息管理',
          component: () => import('@/page/STB/base/index'),
          meta:{
            showBreadcrumb:true,
            title:'机顶盒基础信息管理',
          }
         },
         {
          path: '/STBoperation',
          name: '机顶盒运维信息管理',
          component: () => import('@/page/STB/operation/index'),
          meta:{
            showBreadcrumb:true,
            title:'机顶盒运维信息管理',
          }
         },
        //=======================================机顶盒管理 end ===================================//
qzhxx's avatar
qzhxx committed
525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546
      ]
    },


  ]
})
router.beforeEach((to, from, next) => {
  if(to.meta.requireBackLogin){
    let user = localStorage.getItem("userId");
    if (user) {  // 通过vuex state获取当前的token是否存在
      return next();
    }else {
      next({
        path: '/',
        query: {redirect:to.fullPath},
      })
    }
  }else {
    next();
  }
})
export default router