fix: router
This commit is contained in:
parent
2cbd8af6ad
commit
cd88d9d099
@ -1,10 +1,10 @@
|
|||||||
import {PermissionConst, EditionConst, RoleConst} from '@/utils/permission/data'
|
import { PermissionConst, EditionConst, RoleConst } from '@/utils/permission/data'
|
||||||
import {ComplexPermission} from '@/utils/permission/type'
|
import { ComplexPermission } from '@/utils/permission/type'
|
||||||
|
|
||||||
const systemRouter = {
|
const systemRouter = {
|
||||||
path: '/system',
|
path: '/system',
|
||||||
name: 'system',
|
name: 'system',
|
||||||
meta: {title: 'views.system.title'},
|
meta: { title: 'views.system.title' },
|
||||||
hidden: true,
|
hidden: true,
|
||||||
component: () => import('@/layout/layout-template/SystemMainLayout.vue'),
|
component: () => import('@/layout/layout-template/SystemMainLayout.vue'),
|
||||||
children: [
|
children: [
|
||||||
@ -23,28 +23,6 @@ const systemRouter = {
|
|||||||
},
|
},
|
||||||
component: () => import('@/views/system/user-manage/index.vue'),
|
component: () => import('@/views/system/user-manage/index.vue'),
|
||||||
},
|
},
|
||||||
{
|
|
||||||
path: '/system/role',
|
|
||||||
name: 'role',
|
|
||||||
meta: {
|
|
||||||
icon: 'app-role',
|
|
||||||
iconActive: 'app-role-active',
|
|
||||||
title: 'views.role.title',
|
|
||||||
activeMenu: '/system',
|
|
||||||
parentPath: '/system',
|
|
||||||
parentName: 'system',
|
|
||||||
sameRoute: 'role',
|
|
||||||
permission: [
|
|
||||||
new ComplexPermission(
|
|
||||||
[RoleConst.ADMIN, RoleConst.WORKSPACE_MANAGE.getWorkspaceRole],
|
|
||||||
[PermissionConst.ROLE_READ, PermissionConst.WORKSPACE_ROLE_READ],
|
|
||||||
[EditionConst.IS_EE, EditionConst.IS_PE],
|
|
||||||
'OR',
|
|
||||||
),
|
|
||||||
],
|
|
||||||
},
|
|
||||||
component: () => import('@/views/system/role/index.vue'),
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
path: '/system/workspace',
|
path: '/system/workspace',
|
||||||
name: 'workspace',
|
name: 'workspace',
|
||||||
@ -67,6 +45,29 @@ const systemRouter = {
|
|||||||
},
|
},
|
||||||
component: () => import('@/views/system/workspace/index.vue'),
|
component: () => import('@/views/system/workspace/index.vue'),
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: '/system/role',
|
||||||
|
name: 'role',
|
||||||
|
meta: {
|
||||||
|
icon: 'app-role',
|
||||||
|
iconActive: 'app-role-active',
|
||||||
|
title: 'views.role.title',
|
||||||
|
activeMenu: '/system',
|
||||||
|
parentPath: '/system',
|
||||||
|
parentName: 'system',
|
||||||
|
sameRoute: 'role',
|
||||||
|
permission: [
|
||||||
|
new ComplexPermission(
|
||||||
|
[RoleConst.ADMIN, RoleConst.WORKSPACE_MANAGE.getWorkspaceRole],
|
||||||
|
[PermissionConst.ROLE_READ, PermissionConst.WORKSPACE_ROLE_READ],
|
||||||
|
[EditionConst.IS_EE, EditionConst.IS_PE],
|
||||||
|
'OR',
|
||||||
|
),
|
||||||
|
],
|
||||||
|
},
|
||||||
|
component: () => import('@/views/system/role/index.vue'),
|
||||||
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
path: '/system/resource-management',
|
path: '/system/resource-management',
|
||||||
name: 'resourceManagement',
|
name: 'resourceManagement',
|
||||||
@ -123,7 +124,8 @@ const systemRouter = {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
component: () => import('@/views/system-resource-management/ApplicationResourceIndex.vue'),
|
component: () =>
|
||||||
|
import('@/views/system-resource-management/ApplicationResourceIndex.vue'),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/system/resource-management/knowledge',
|
path: '/system/resource-management/knowledge',
|
||||||
@ -197,18 +199,47 @@ const systemRouter = {
|
|||||||
parentPath: '/system',
|
parentPath: '/system',
|
||||||
parentName: 'system',
|
parentName: 'system',
|
||||||
sameRoute: 'authorization',
|
sameRoute: 'authorization',
|
||||||
permission: [new ComplexPermission([RoleConst.ADMIN, RoleConst.WORKSPACE_MANAGE],
|
permission: [
|
||||||
[PermissionConst.APPLICATION_WORKSPACE_USER_RESOURCE_PERMISSION_READ,
|
new ComplexPermission(
|
||||||
PermissionConst.APPLICATION_WORKSPACE_USER_RESOURCE_PERMISSION_READ.getWorkspacePermissionWorkspaceManageRole], [], 'OR'),
|
[RoleConst.ADMIN, RoleConst.WORKSPACE_MANAGE],
|
||||||
new ComplexPermission([RoleConst.ADMIN, RoleConst.WORKSPACE_MANAGE],
|
[
|
||||||
[PermissionConst.KNOWLEDGE_WORKSPACE_USER_RESOURCE_PERMISSION_READ,
|
PermissionConst.APPLICATION_WORKSPACE_USER_RESOURCE_PERMISSION_READ,
|
||||||
PermissionConst.KNOWLEDGE_WORKSPACE_USER_RESOURCE_PERMISSION_READ.getWorkspacePermissionWorkspaceManageRole], [], 'OR'),
|
PermissionConst.APPLICATION_WORKSPACE_USER_RESOURCE_PERMISSION_READ
|
||||||
new ComplexPermission([RoleConst.ADMIN, RoleConst.WORKSPACE_MANAGE],
|
.getWorkspacePermissionWorkspaceManageRole,
|
||||||
[PermissionConst.TOOL_WORKSPACE_USER_RESOURCE_PERMISSION_READ,
|
],
|
||||||
PermissionConst.TOOL_WORKSPACE_USER_RESOURCE_PERMISSION_READ.getWorkspacePermissionWorkspaceManageRole], [], 'OR'),
|
[],
|
||||||
new ComplexPermission([RoleConst.ADMIN, RoleConst.WORKSPACE_MANAGE],
|
'OR',
|
||||||
[PermissionConst.MODEL_WORKSPACE_USER_RESOURCE_PERMISSION_READ,
|
),
|
||||||
PermissionConst.MODEL_WORKSPACE_USER_RESOURCE_PERMISSION_READ.getWorkspacePermissionWorkspaceManageRole], [], 'OR'),
|
new ComplexPermission(
|
||||||
|
[RoleConst.ADMIN, RoleConst.WORKSPACE_MANAGE],
|
||||||
|
[
|
||||||
|
PermissionConst.KNOWLEDGE_WORKSPACE_USER_RESOURCE_PERMISSION_READ,
|
||||||
|
PermissionConst.KNOWLEDGE_WORKSPACE_USER_RESOURCE_PERMISSION_READ
|
||||||
|
.getWorkspacePermissionWorkspaceManageRole,
|
||||||
|
],
|
||||||
|
[],
|
||||||
|
'OR',
|
||||||
|
),
|
||||||
|
new ComplexPermission(
|
||||||
|
[RoleConst.ADMIN, RoleConst.WORKSPACE_MANAGE],
|
||||||
|
[
|
||||||
|
PermissionConst.TOOL_WORKSPACE_USER_RESOURCE_PERMISSION_READ,
|
||||||
|
PermissionConst.TOOL_WORKSPACE_USER_RESOURCE_PERMISSION_READ
|
||||||
|
.getWorkspacePermissionWorkspaceManageRole,
|
||||||
|
],
|
||||||
|
[],
|
||||||
|
'OR',
|
||||||
|
),
|
||||||
|
new ComplexPermission(
|
||||||
|
[RoleConst.ADMIN, RoleConst.WORKSPACE_MANAGE],
|
||||||
|
[
|
||||||
|
PermissionConst.MODEL_WORKSPACE_USER_RESOURCE_PERMISSION_READ,
|
||||||
|
PermissionConst.MODEL_WORKSPACE_USER_RESOURCE_PERMISSION_READ
|
||||||
|
.getWorkspacePermissionWorkspaceManageRole,
|
||||||
|
],
|
||||||
|
[],
|
||||||
|
'OR',
|
||||||
|
),
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -223,9 +254,18 @@ const systemRouter = {
|
|||||||
parentName: 'system',
|
parentName: 'system',
|
||||||
resource: 'APPLICATION',
|
resource: 'APPLICATION',
|
||||||
sameRoute: 'authorization',
|
sameRoute: 'authorization',
|
||||||
permission: [new ComplexPermission([RoleConst.ADMIN, RoleConst.WORKSPACE_MANAGE],
|
permission: [
|
||||||
[PermissionConst.APPLICATION_WORKSPACE_USER_RESOURCE_PERMISSION_READ,
|
new ComplexPermission(
|
||||||
PermissionConst.APPLICATION_WORKSPACE_USER_RESOURCE_PERMISSION_READ.getWorkspacePermissionWorkspaceManageRole], [], 'OR'),]
|
[RoleConst.ADMIN, RoleConst.WORKSPACE_MANAGE],
|
||||||
|
[
|
||||||
|
PermissionConst.APPLICATION_WORKSPACE_USER_RESOURCE_PERMISSION_READ,
|
||||||
|
PermissionConst.APPLICATION_WORKSPACE_USER_RESOURCE_PERMISSION_READ
|
||||||
|
.getWorkspacePermissionWorkspaceManageRole,
|
||||||
|
],
|
||||||
|
[],
|
||||||
|
'OR',
|
||||||
|
),
|
||||||
|
],
|
||||||
},
|
},
|
||||||
component: () => import('@/views/system/resource-authorization/index.vue'),
|
component: () => import('@/views/system/resource-authorization/index.vue'),
|
||||||
},
|
},
|
||||||
@ -239,9 +279,18 @@ const systemRouter = {
|
|||||||
parentName: 'system',
|
parentName: 'system',
|
||||||
resource: 'KNOWLEDGE',
|
resource: 'KNOWLEDGE',
|
||||||
sameRoute: 'authorization',
|
sameRoute: 'authorization',
|
||||||
permission: [new ComplexPermission([RoleConst.ADMIN, RoleConst.WORKSPACE_MANAGE],
|
permission: [
|
||||||
[PermissionConst.KNOWLEDGE_WORKSPACE_USER_RESOURCE_PERMISSION_READ,
|
new ComplexPermission(
|
||||||
PermissionConst.KNOWLEDGE_WORKSPACE_USER_RESOURCE_PERMISSION_READ.getWorkspacePermissionWorkspaceManageRole], [], 'OR'),]
|
[RoleConst.ADMIN, RoleConst.WORKSPACE_MANAGE],
|
||||||
|
[
|
||||||
|
PermissionConst.KNOWLEDGE_WORKSPACE_USER_RESOURCE_PERMISSION_READ,
|
||||||
|
PermissionConst.KNOWLEDGE_WORKSPACE_USER_RESOURCE_PERMISSION_READ
|
||||||
|
.getWorkspacePermissionWorkspaceManageRole,
|
||||||
|
],
|
||||||
|
[],
|
||||||
|
'OR',
|
||||||
|
),
|
||||||
|
],
|
||||||
},
|
},
|
||||||
component: () => import('@/views/system/resource-authorization/index.vue'),
|
component: () => import('@/views/system/resource-authorization/index.vue'),
|
||||||
},
|
},
|
||||||
@ -255,9 +304,18 @@ const systemRouter = {
|
|||||||
parentName: 'system',
|
parentName: 'system',
|
||||||
resource: 'TOOL',
|
resource: 'TOOL',
|
||||||
sameRoute: 'authorization',
|
sameRoute: 'authorization',
|
||||||
permission: [new ComplexPermission([RoleConst.ADMIN, RoleConst.WORKSPACE_MANAGE],
|
permission: [
|
||||||
[PermissionConst.TOOL_WORKSPACE_USER_RESOURCE_PERMISSION_READ,
|
new ComplexPermission(
|
||||||
PermissionConst.TOOL_WORKSPACE_USER_RESOURCE_PERMISSION_READ.getWorkspacePermissionWorkspaceManageRole], [], 'OR'),]
|
[RoleConst.ADMIN, RoleConst.WORKSPACE_MANAGE],
|
||||||
|
[
|
||||||
|
PermissionConst.TOOL_WORKSPACE_USER_RESOURCE_PERMISSION_READ,
|
||||||
|
PermissionConst.TOOL_WORKSPACE_USER_RESOURCE_PERMISSION_READ
|
||||||
|
.getWorkspacePermissionWorkspaceManageRole,
|
||||||
|
],
|
||||||
|
[],
|
||||||
|
'OR',
|
||||||
|
),
|
||||||
|
],
|
||||||
},
|
},
|
||||||
component: () => import('@/views/system/resource-authorization/index.vue'),
|
component: () => import('@/views/system/resource-authorization/index.vue'),
|
||||||
},
|
},
|
||||||
@ -271,9 +329,18 @@ const systemRouter = {
|
|||||||
parentName: 'system',
|
parentName: 'system',
|
||||||
resource: 'MODEL',
|
resource: 'MODEL',
|
||||||
sameRoute: 'authorization',
|
sameRoute: 'authorization',
|
||||||
permission: [new ComplexPermission([RoleConst.ADMIN, RoleConst.WORKSPACE_MANAGE],
|
permission: [
|
||||||
[PermissionConst.MODEL_WORKSPACE_USER_RESOURCE_PERMISSION_READ,
|
new ComplexPermission(
|
||||||
PermissionConst.MODEL_WORKSPACE_USER_RESOURCE_PERMISSION_READ.getWorkspacePermissionWorkspaceManageRole], [], 'OR'),]
|
[RoleConst.ADMIN, RoleConst.WORKSPACE_MANAGE],
|
||||||
|
[
|
||||||
|
PermissionConst.MODEL_WORKSPACE_USER_RESOURCE_PERMISSION_READ,
|
||||||
|
PermissionConst.MODEL_WORKSPACE_USER_RESOURCE_PERMISSION_READ
|
||||||
|
.getWorkspacePermissionWorkspaceManageRole,
|
||||||
|
],
|
||||||
|
[],
|
||||||
|
'OR',
|
||||||
|
),
|
||||||
|
],
|
||||||
},
|
},
|
||||||
component: () => import('@/views/system/resource-authorization/index.vue'),
|
component: () => import('@/views/system/resource-authorization/index.vue'),
|
||||||
},
|
},
|
||||||
@ -488,12 +555,7 @@ const systemRouter = {
|
|||||||
[EditionConst.IS_EE, EditionConst.IS_PE],
|
[EditionConst.IS_EE, EditionConst.IS_PE],
|
||||||
'OR',
|
'OR',
|
||||||
),
|
),
|
||||||
new ComplexPermission(
|
new ComplexPermission([RoleConst.ADMIN], [PermissionConst.EMAIL_SETTING_READ], [], 'OR'),
|
||||||
[RoleConst.ADMIN],
|
|
||||||
[PermissionConst.EMAIL_SETTING_READ],
|
|
||||||
[],
|
|
||||||
'OR',
|
|
||||||
),
|
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
children: [
|
children: [
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user