管道基础大数据平台系统开发-【前端】-新系統界面
Surpriseplus
2023-06-13 2aba5be94bcbb03bb5ec13d121fe945c2f8dce38
src/router/index.js
@@ -36,6 +36,7 @@
import addStyle from '../views/datamanage/addStyle.vue'; //数据管理-样式管理-添加样式
import ExportMap from '../views/exportMap/index.vue'; //在线制图
import userInfoManage from '../views/userManage/userInfoManage.vue'; // 用户管理模块
import templateManage from '../views/userManage/templateManage.vue'; // 模板管理
import orgManage from '../views/userManage/orgManage.vue'; // 用户管理模块
import userAuditing from '../views/userManage/userAuditing.vue'; // 用户管理模块
import roleManage from '../views/userManage/roleManage.vue'; // 用户管理模块
@@ -47,13 +48,33 @@
import roleResAuthorization from '@/views/AuthorizationManagement/roleResAuthorization.vue'; //系统管理-角色资源授权
import roleMenuAuthorization from '@/views/AuthorizationManagement/roleMenuAuthorization.vue'; //系统管理-角色菜单授权
import layerManagement from '@/views/datamanage/layerManagement.vue'; //数据管理-菜单管理
import bankController from '../views/datamanage/bankController.vue';//数据库管理
import projectController from '../views/datamanage/projectController.vue';//项目管理
import systemController from '@/views/maintenance/systemController.vue';//系统管理
import empowerController from '@/views/maintenance/empowerController.vue';//授权管理
import opexController from '@/views/maintenance/opexController.vue';//运维监控
import dataCount from '@/views/datamanage/dataStatistics.vue'; //数据统计
//包二
import WareInspection from '@/views/PackageTwo/WareInspection.vue'; //数据质检-入库质检
import QualityInspection from '@/views/PackageTwo/index.vue'; //数据质检-入库质检
const originalPush = VueRouter.prototype.push;
VueRouter.prototype.push = function push(location) {
  return originalPush.call(this, location).catch((err) => err);
  const nowPage = sessionStorage.getItem('routerName')
  const page = {
    path: nowPage
  }
  if (page === location || location === '/') {
    return originalPush.call(this, page).catch((err) => err);
  } else {
    return originalPush.call(this, location).catch((err) => err);
  }
};
// 群组管理
@@ -69,7 +90,7 @@
    path: '/Thematic',
    name: 'Thematic',
    component: Thematic,
  },
  {
    path: '/',
@@ -87,11 +108,65 @@
        },
      },
      {
        path: '/QualityInspection',
        component: QualityInspection,
        name: 'QualityInspection',
        meta: {
          title: '入库质检',
          requireAuth: true, // 标识该路由是否需要登录
        },
      },
      {
        path: '/mochaitmo',
        component: mochaitmo,
        name: 'mochaitmo',
        meta: {
          title: '运维管理',
          requireAuth: true, // 标识该路由是否需要登录
        },
      },
      {
        path: '/systemController',
        component: systemController,
        name: 'systemController',
        meta: {
          title: '系统管理',
          requireAuth: true, // 标识该路由是否需要登录
        },
      },
      {
        path: '/empowerController',
        component: empowerController,
        name: 'empowerController',
        meta: {
          title: '授权管理',
          requireAuth: true, // 标识该路由是否需要登录
        },
      },
      {
        path: '/opexController',
        component: opexController,
        name: 'opexController',
        meta: {
          title: '运维监控',
          requireAuth: true, // 标识该路由是否需要登录
        },
      },
      {
        path: '/bankController',
        component: bankController,
        name: 'bankController',
        meta: {
          title: '数据库管理',
          requireAuth: true, // 标识该路由是否需要登录
        },
      },
      {
        path: '/projectController',
        component: projectController,
        name: 'projectController',
        meta: {
          title: '项目管理',
          requireAuth: true, // 标识该路由是否需要登录
        },
      },
@@ -131,7 +206,15 @@
          requireAuth: true, // 标识该路由是否需要登录
        },
      },
      {
        path: '/dataCount',
        name: 'dataCount',
        component: dataCount,
        meta: {
          title: '数据统计',
          requireAuth: true, // 标识该路由是否需要登录
        },
      },
      {
        path: '/Archive',
        name: 'Archive',
@@ -354,6 +437,15 @@
        },
      },
      {
        path: '/templateManage',
        component: templateManage,
        name: 'templateManage',
        meta: {
          title: '模板管理',
          requireAuth: true, // 标识该路由是否需要登录
        },
      },
      {
        path: '/orgManage',
        component: orgManage,
        name: 'orgManage',
@@ -453,6 +545,7 @@
});
//路由守卫
router.beforeEach((to, from, next) => {
  sessionStorage.setItem('routerName', to.path)
  next();
  if (to.matched.some((auth) => auth.meta.requireAuth)) {
    // 获取token