|
@@ -30,239 +30,222 @@ import Layout from '@/layout'
|
|
|
|
|
|
// 公共路由
|
|
|
export const constantRoutes = [{
|
|
|
- path: '/redirect',
|
|
|
- component: Layout,
|
|
|
- hidden: true,
|
|
|
- children: [{
|
|
|
- path: '/redirect/:path(.*)',
|
|
|
- component: () => import('@/views/redirect')
|
|
|
- }]
|
|
|
- },
|
|
|
- {
|
|
|
- path: '/login',
|
|
|
- component: () => import('@/views/login'),
|
|
|
- hidden: true
|
|
|
- },
|
|
|
- {
|
|
|
- path: '/register',
|
|
|
- component: () => import('@/views/register'),
|
|
|
- hidden: true
|
|
|
- },
|
|
|
- {
|
|
|
- path: '/404',
|
|
|
- component: () => import('@/views/error/404'),
|
|
|
- hidden: true
|
|
|
- },
|
|
|
- {
|
|
|
- path: '/401',
|
|
|
- component: () => import('@/views/error/401'),
|
|
|
- hidden: true
|
|
|
- },
|
|
|
- {
|
|
|
- path: '',
|
|
|
- component: Layout,
|
|
|
- redirect: 'index',
|
|
|
- children: [{
|
|
|
- path: 'index',
|
|
|
- component: () => import('@/views/index'),
|
|
|
- name: 'Index',
|
|
|
- meta: {
|
|
|
- title: '首页',
|
|
|
- icon: 'dashboard',
|
|
|
- affix: true
|
|
|
- }
|
|
|
- }]
|
|
|
- },
|
|
|
- {
|
|
|
- path: '/user',
|
|
|
- component: Layout,
|
|
|
- hidden: true,
|
|
|
- redirect: 'noredirect',
|
|
|
- children: [{
|
|
|
- path: 'profile',
|
|
|
- component: () => import('@/views/system/user/profile/index'),
|
|
|
- name: 'Profile',
|
|
|
- meta: {
|
|
|
- title: '个人中心',
|
|
|
- icon: 'user'
|
|
|
- }
|
|
|
- }]
|
|
|
- },
|
|
|
- {
|
|
|
- path: '/home',
|
|
|
- component: () => import('@/views1/HomeView.vue'),
|
|
|
- hidden: true,
|
|
|
- children: [{
|
|
|
- path: "/home/page",
|
|
|
- component: () => import('@/views1/Page/PageView.vue')
|
|
|
- },
|
|
|
- {
|
|
|
- path: "/home/retrieval",
|
|
|
- component: () => import('@/views1/Retrieval/RetrievalView.vue')
|
|
|
- },
|
|
|
- {
|
|
|
- path: "/home/retrieval/list",
|
|
|
- component: () => import('@/views1/Retrieval/List/ListView.vue')
|
|
|
- },
|
|
|
- {
|
|
|
- path: "/home/file",
|
|
|
- component: () => import('@/views1/File/FileView.vue')
|
|
|
- },
|
|
|
- {
|
|
|
- path: "/home/file/part",
|
|
|
- component: () => import('@/views1/File/Part/PartView.vue')
|
|
|
- },
|
|
|
- {
|
|
|
- path: "/home/file/publi",
|
|
|
- component: () => import('@/views1/File/Publi/PublicView.vue')
|
|
|
- },
|
|
|
- {
|
|
|
- path: "/home/file/individual",
|
|
|
- component: () => import('@/views1/File/Individual/IndividualView.vue')
|
|
|
- },
|
|
|
- {
|
|
|
- path: "/home/file/set",
|
|
|
- component: () => import('@/views1/File/Set/SetView.vue')
|
|
|
- },
|
|
|
- {
|
|
|
- path: "/home/personal",
|
|
|
- component: () => import('@/views1/Personal/PersonalView.vue')
|
|
|
- },
|
|
|
- {
|
|
|
- path: "/home/personal/classify",
|
|
|
- component: () => import('@/views1/Personal/Classify/ClassifyView.vue')
|
|
|
- },
|
|
|
- {
|
|
|
- path: "/home/personal/space",
|
|
|
- component: () => import('@/views1/Personal/Space/SpaceView.vue')
|
|
|
- },
|
|
|
- {
|
|
|
- path: "/home/personal/modify",
|
|
|
- component: () => import('@/views1/Personal/Modify/ModifyView.vue')
|
|
|
- },
|
|
|
- {
|
|
|
- path: "/home/system",
|
|
|
- component: () => import('@/views1/System/SystemView.vue')
|
|
|
- },
|
|
|
- {
|
|
|
- path: "/home/system/organization",
|
|
|
- component: () => import('@/views1/System/Organization/OrganizationView.vue')
|
|
|
- },
|
|
|
- {
|
|
|
- path: "/home/system/user",
|
|
|
- component: () => import('@/views1/System/User/UserView.vue')
|
|
|
- },
|
|
|
- {
|
|
|
- path: "/home/system/authority",
|
|
|
- component: () => import('@/views1/System/Authority/AuthorityView.vue')
|
|
|
- },{
|
|
|
- path: "/home/system/notes",
|
|
|
- component: () => import('@/views1/System/Notes/NotesView.vue')
|
|
|
- },{
|
|
|
- path: "/home/system/space",
|
|
|
- component: () => import('@/views1/System/Space/SpaceView.vue')
|
|
|
- }
|
|
|
- ],
|
|
|
- },
|
|
|
- {
|
|
|
- path: '/login1',
|
|
|
- component: () => import('@/views1/LoginView.vue'),
|
|
|
- hidden: true,
|
|
|
- },
|
|
|
-]
|
|
|
+ path: '/redirect',
|
|
|
+ component: Layout,
|
|
|
+ hidden: true,
|
|
|
+ children: [{
|
|
|
+ path: '/redirect/:path(.*)',
|
|
|
+ component: () => import('@/views/redirect')
|
|
|
+ }]
|
|
|
+}, {
|
|
|
+ path: '/login',
|
|
|
+ component: () => import('@/views/login'),
|
|
|
+ hidden: true
|
|
|
+}, {
|
|
|
+ path: '/register',
|
|
|
+ component: () => import('@/views/register'),
|
|
|
+ hidden: true
|
|
|
+}, {
|
|
|
+ path: '/404',
|
|
|
+ component: () => import('@/views/error/404'),
|
|
|
+ hidden: true
|
|
|
+}, {
|
|
|
+ path: '/401',
|
|
|
+ component: () => import('@/views/error/401'),
|
|
|
+ hidden: true
|
|
|
+}, {
|
|
|
+ path: '',
|
|
|
+ component: Layout,
|
|
|
+ redirect: 'index',
|
|
|
+ children: [{
|
|
|
+ path: 'index',
|
|
|
+ component: () => import('@/views/index'),
|
|
|
+ name: 'Index',
|
|
|
+ meta: {
|
|
|
+ title: '首页',
|
|
|
+ icon: 'dashboard',
|
|
|
+ affix: true
|
|
|
+ }
|
|
|
+ }]
|
|
|
+}, {
|
|
|
+ path: '/user',
|
|
|
+ component: Layout,
|
|
|
+ hidden: true,
|
|
|
+ redirect: 'noredirect',
|
|
|
+ children: [{
|
|
|
+ path: 'profile',
|
|
|
+ component: () => import('@/views/system/user/profile/index'),
|
|
|
+ name: 'Profile',
|
|
|
+ meta: {
|
|
|
+ title: '个人中心',
|
|
|
+ icon: 'user'
|
|
|
+ }
|
|
|
+ }]
|
|
|
+}, {
|
|
|
+ path: '/home',
|
|
|
+ component: () => import('@/views1/HomeView.vue'),
|
|
|
+ hidden: true,
|
|
|
+ children: [{
|
|
|
+ path: "/home/page",
|
|
|
+ component: () => import('@/views1/Page/PageView.vue')
|
|
|
+ }, {
|
|
|
+ path: "/home/retrieval",
|
|
|
+ component: () => import('@/views1/Retrieval/RetrievalView.vue')
|
|
|
+ }, {
|
|
|
+ path: "/home/retrieval/list",
|
|
|
+ component: () => import('@/views1/Retrieval/List/ListView.vue')
|
|
|
+ }, {
|
|
|
+ path: "/home/file",
|
|
|
+ component: () => import('@/views1/File/FileView.vue')
|
|
|
+ }, {
|
|
|
+ path: "/home/file/part",
|
|
|
+ component: () => import('@/views1/File/Part/PartView.vue')
|
|
|
+ }, {
|
|
|
+ path: "/home/file/publi",
|
|
|
+ component: () => import('@/views1/File/Publi/PublicView.vue')
|
|
|
+ }, {
|
|
|
+ path: "/home/file/individual",
|
|
|
+ component: () => import('@/views1/File/Individual/IndividualView.vue')
|
|
|
+ }, {
|
|
|
+ path: "/home/file/set",
|
|
|
+ component: () => import('@/views1/File/Set/SetView.vue')
|
|
|
+ }, {
|
|
|
+ path: "/home/personal",
|
|
|
+ component: () => import('@/views1/Personal/PersonalView.vue')
|
|
|
+ }, {
|
|
|
+ path: "/home/personal/classify",
|
|
|
+ component: () => import('@/views1/Personal/Classify/ClassifyView.vue')
|
|
|
+ }, {
|
|
|
+ path: "/home/personal/space",
|
|
|
+ component: () => import('@/views1/Personal/Space/SpaceView.vue')
|
|
|
+ }, {
|
|
|
+ path: "/home/personal/modify",
|
|
|
+ component: () => import('@/views1/Personal/Modify/ModifyView.vue')
|
|
|
+ }, {
|
|
|
+ path: "/home/system",
|
|
|
+ component: () => import('@/views1/System/SystemView.vue')
|
|
|
+ }, {
|
|
|
+ path: "/home/system/organization",
|
|
|
+ component: () => import('@/views1/System/Organization/OrganizationView.vue')
|
|
|
+ }, {
|
|
|
+ path: "/home/system/user",
|
|
|
+ component: () => import('@/views1/System/User/UserView.vue')
|
|
|
+ }, {
|
|
|
+ path: "/home/system/authority",
|
|
|
+ component: () => import('@/views1/System/Authority/AuthorityView.vue')
|
|
|
+ }, {
|
|
|
+ path: "/home/system/notes",
|
|
|
+ component: () => import('@/views1/System/Notes/NotesView.vue')
|
|
|
+ }, {
|
|
|
+ path: "/home/system/space",
|
|
|
+ component: () => import('@/views1/System/Space/SpaceView.vue')
|
|
|
+ }],
|
|
|
+}, {
|
|
|
+ path: '/login1',
|
|
|
+ component: () => import('@/views1/LoginView.vue'),
|
|
|
+ hidden: true,
|
|
|
+}, ]
|
|
|
|
|
|
// 动态路由,基于用户权限动态去加载
|
|
|
export const dynamicRoutes = [{
|
|
|
- path: '/system/user-auth',
|
|
|
- component: Layout,
|
|
|
- hidden: true,
|
|
|
- permissions: ['system:user:edit'],
|
|
|
- children: [{
|
|
|
- path: 'role/:userId(\\d+)',
|
|
|
- component: () => import('@/views/system/user/authRole'),
|
|
|
- name: 'AuthRole',
|
|
|
- meta: {
|
|
|
- title: '分配角色',
|
|
|
- activeMenu: '/system/user'
|
|
|
- }
|
|
|
- }]
|
|
|
- },
|
|
|
- {
|
|
|
- path: '/system/role-auth',
|
|
|
- component: Layout,
|
|
|
- hidden: true,
|
|
|
- permissions: ['system:role:edit'],
|
|
|
- children: [{
|
|
|
- path: 'user/:roleId(\\d+)',
|
|
|
- component: () => import('@/views/system/role/authUser'),
|
|
|
- name: 'AuthUser',
|
|
|
- meta: {
|
|
|
- title: '分配用户',
|
|
|
- activeMenu: '/system/role'
|
|
|
- }
|
|
|
- }]
|
|
|
- },
|
|
|
- {
|
|
|
- path: '/system/dict-data',
|
|
|
- component: Layout,
|
|
|
- hidden: true,
|
|
|
- permissions: ['system:dict:list'],
|
|
|
- children: [{
|
|
|
- path: 'index/:dictId(\\d+)',
|
|
|
- component: () => import('@/views/system/dict/data'),
|
|
|
- name: 'Data',
|
|
|
- meta: {
|
|
|
- title: '字典数据',
|
|
|
- activeMenu: '/system/dict'
|
|
|
- }
|
|
|
- }]
|
|
|
- },
|
|
|
- {
|
|
|
- path: '/monitor/job-log',
|
|
|
- component: Layout,
|
|
|
- hidden: true,
|
|
|
- permissions: ['monitor:job:list'],
|
|
|
- children: [{
|
|
|
- path: 'index/:jobId(\\d+)',
|
|
|
- component: () => import('@/views/monitor/job/log'),
|
|
|
- name: 'JobLog',
|
|
|
- meta: {
|
|
|
- title: '调度日志',
|
|
|
- activeMenu: '/monitor/job'
|
|
|
- }
|
|
|
- }]
|
|
|
- },
|
|
|
- {
|
|
|
- path: '/tool/gen-edit',
|
|
|
- component: Layout,
|
|
|
- hidden: true,
|
|
|
- permissions: ['tool:gen:edit'],
|
|
|
- children: [{
|
|
|
- path: 'index/:tableId(\\d+)',
|
|
|
- component: () => import('@/views/tool/gen/editTable'),
|
|
|
- name: 'GenEdit',
|
|
|
- meta: {
|
|
|
- title: '修改生成配置',
|
|
|
- activeMenu: '/tool/gen'
|
|
|
- }
|
|
|
- }]
|
|
|
- },
|
|
|
- {
|
|
|
- path: '/doc/oo-edit',
|
|
|
- component: Layout,
|
|
|
- hidden: true,
|
|
|
- permissions: ['tool:gen:edit'],
|
|
|
- children: [{
|
|
|
- path: 'index/:docId(\\d+)',
|
|
|
- component: () => import('@/views/doc/oo/edit'),
|
|
|
- name: 'OoEdit',
|
|
|
- meta: {
|
|
|
- title: '文件在线编辑',
|
|
|
- activeMenu: '/doc/info'
|
|
|
- }
|
|
|
- }]
|
|
|
- }
|
|
|
-]
|
|
|
+ path: '/system/user-auth',
|
|
|
+ component: Layout,
|
|
|
+ hidden: true,
|
|
|
+ permissions: ['system:user:edit'],
|
|
|
+ children: [{
|
|
|
+ path: 'role/:userId(\\d+)',
|
|
|
+ component: () => import('@/views/system/user/authRole'),
|
|
|
+ name: 'AuthRole',
|
|
|
+ meta: {
|
|
|
+ title: '分配角色',
|
|
|
+ activeMenu: '/system/user'
|
|
|
+ }
|
|
|
+ }]
|
|
|
+}, {
|
|
|
+ path: '/system/role-auth',
|
|
|
+ component: Layout,
|
|
|
+ hidden: true,
|
|
|
+ permissions: ['system:role:edit'],
|
|
|
+ children: [{
|
|
|
+ path: 'user/:roleId(\\d+)',
|
|
|
+ component: () => import('@/views/system/role/authUser'),
|
|
|
+ name: 'AuthUser',
|
|
|
+ meta: {
|
|
|
+ title: '分配用户',
|
|
|
+ activeMenu: '/system/role'
|
|
|
+ }
|
|
|
+ }]
|
|
|
+}, {
|
|
|
+ path: '/system/dict-data',
|
|
|
+ component: Layout,
|
|
|
+ hidden: true,
|
|
|
+ permissions: ['system:dict:list'],
|
|
|
+ children: [{
|
|
|
+ path: 'index/:dictId(\\d+)',
|
|
|
+ component: () => import('@/views/system/dict/data'),
|
|
|
+ name: 'Data',
|
|
|
+ meta: {
|
|
|
+ title: '字典数据',
|
|
|
+ activeMenu: '/system/dict'
|
|
|
+ }
|
|
|
+ }]
|
|
|
+}, {
|
|
|
+ path: '/monitor/job-log',
|
|
|
+ component: Layout,
|
|
|
+ hidden: true,
|
|
|
+ permissions: ['monitor:job:list'],
|
|
|
+ children: [{
|
|
|
+ path: 'index/:jobId(\\d+)',
|
|
|
+ component: () => import('@/views/monitor/job/log'),
|
|
|
+ name: 'JobLog',
|
|
|
+ meta: {
|
|
|
+ title: '调度日志',
|
|
|
+ activeMenu: '/monitor/job'
|
|
|
+ }
|
|
|
+ }]
|
|
|
+}, {
|
|
|
+ path: '/tool/gen-edit',
|
|
|
+ component: Layout,
|
|
|
+ hidden: true,
|
|
|
+ permissions: ['tool:gen:edit'],
|
|
|
+ children: [{
|
|
|
+ path: 'index/:tableId(\\d+)',
|
|
|
+ component: () => import('@/views/tool/gen/editTable'),
|
|
|
+ name: 'GenEdit',
|
|
|
+ meta: {
|
|
|
+ title: '修改生成配置',
|
|
|
+ activeMenu: '/tool/gen'
|
|
|
+ }
|
|
|
+ }]
|
|
|
+}, {
|
|
|
+ path: '/doc/oo-edit',
|
|
|
+ component: Layout,
|
|
|
+ hidden: true,
|
|
|
+ permissions: ['doc:info:edit'],
|
|
|
+ children: [{
|
|
|
+ path: 'index/:docId(\\d+)',
|
|
|
+ component: () => import('@/views/doc/oo/edit'),
|
|
|
+ name: 'OoEdit',
|
|
|
+ meta: {
|
|
|
+ title: '文件在线编辑',
|
|
|
+ activeMenu: '/doc/info'
|
|
|
+ }
|
|
|
+ }]
|
|
|
+}, {
|
|
|
+ path: '/doc/group-user/',
|
|
|
+ component: Layout,
|
|
|
+ hidden: true,
|
|
|
+ permissions: ['doc:groupUser:edit'],
|
|
|
+ children: [{
|
|
|
+ path: 'user/:groupId(\\d+)',
|
|
|
+ component: () => import('@/views/doc/groupUser/index'),
|
|
|
+ name: 'AuthUser',
|
|
|
+ meta: {
|
|
|
+ title: '分配成员',
|
|
|
+ activeMenu: '/doc/group'
|
|
|
+ }
|
|
|
+ }]
|
|
|
+}]
|
|
|
|
|
|
// 防止连续点击多次路由报错
|
|
|
let routerPush = Router.prototype.push;
|