lxl
2022-11-07 c6a9b11ff0783bcd81a043a179fbc27f685eee70
src/router/index.js
@@ -1,6 +1,6 @@
import Vue from 'vue';
import VueRouter from 'vue-router';
import { getToken } from "@/utils/auth"; // get token from cookie
import { getToken } from '@/utils/auth'; // get token from cookie
import Home from '../views/Home.vue';
import login from '../components/login';
import Synthesis from '../views/Synthesis/index.vue'; //综合展示
@@ -27,6 +27,7 @@
import SpatialData from '../views/datamanage/SpatialData.vue'; //数据管理-空间数据
import versionManage from '../views/datamanage/versionManage.vue'; //数据管理-版本管理
import dictionaryManage from '../views/datamanage/dictionaryManage.vue'; //数据管理-字典管理
import domainManage from '../views/datamanage/domainManage.vue'; //数据管理-值域管理
import styleManage from '../views/datamanage/styleManage.vue'; //数据管理-样式管理
import addStyle from '../views/datamanage/addStyle.vue'; //数据管理-样式管理-添加样式
@@ -36,6 +37,18 @@
import roleManage from '../views/userManage/roleManage.vue'; // 用户管理模块
import groupManage from '../views/userManage/groupManage.vue'; // 用户管理模块
import authorityManage from '@/views/userManage/authorityManage.vue'; //用户管理-权限管理
import resourceManage from '@/views/userManage/resourceManage.vue'; //用户管理-资源管理
import userRoleAuthorization from '@/views/AuthorizationManagement/userRoleAuthorization.vue'; //系统管理-用户角色授权
import menuRoleAuthorization from '@/views/AuthorizationManagement/menuRoleAuthorization.vue'; //系统管理-菜单权限授权
import roleResAuthorization from '@/views/AuthorizationManagement/roleResAuthorization.vue'; //系统管理-角色资源授权
import roleMenuAuthorization from '@/views/AuthorizationManagement/roleMenuAuthorization.vue'; //系统管理-角色菜单授权
const originalPush = VueRouter.prototype.push;
VueRouter.prototype.push = function push(location) {
  return originalPush.call(this, location).catch((err) => err);
};
// 群组管理
Vue.use(VueRouter);
@@ -50,7 +63,7 @@
    path: '/',
    name: 'Home',
    component: Home,
    redirect: "/Synthesis",
    redirect: '/Synthesis',
    children: [
      {
        path: '/Synthesis',
@@ -141,6 +154,15 @@
        name: 'dictionaryManage',
        meta: {
          title: '字典管理',
          requireAuth: true, // 标识该路由是否需要登录
        },
      },
      {
        path: '/domainManage',
        component: domainManage,
        name: 'domainManage',
        meta: {
          title: '值域管理',
          requireAuth: true, // 标识该路由是否需要登录
        },
      },
@@ -328,6 +350,51 @@
          requireAuth: true, // 标识该路由是否需要登录
        },
      },
      {
        path: '/resourceManage',
        component: resourceManage,
        name: 'resourceManage',
        meta: {
          title: '资源管理',
          requireAuth: true, // 标识该路由是否需要登录
        },
      },
      {
        path: '/userRoleAuthorization',
        component: userRoleAuthorization,
        name: 'userRoleAuthorization',
        meta: {
          title: '用户角色授权',
          requireAuth: true, // 标识该路由是否需要登录
        },
      },
      {
        path: '/menuRoleAuthorization',
        component: menuRoleAuthorization,
        name: 'menuRoleAuthorization',
        meta: {
          title: '菜单权限授权',
          requireAuth: true, // 标识该路由是否需要登录
        },
      },
      {
        path: '/roleResAuthorization',
        component: roleResAuthorization,
        name: 'roleResAuthorization',
        meta: {
          title: '菜单权限授权',
          requireAuth: true, // 标识该路由是否需要登录
        },
      },
      {
        path: '/roleMenuAuthorization',
        component: roleMenuAuthorization,
        name: 'roleMenuAuthorization',
        meta: {
          title: '菜单权限授权',
          requireAuth: true, // 标识该路由是否需要登录
        },
      },
    ],
  },
];
@@ -345,7 +412,7 @@
      next();
    } else {
      next({
        path: "/login",
        path: '/login',
      });
    }
  } else {