UnisKB/ui/src/router/modules/setting.ts

111 lines
3.0 KiB
TypeScript
Raw Normal View History

import { hasPermission } from '@/utils/permission/index'
2024-07-10 03:27:52 +00:00
import Layout from '@/layout/layout-template/SystemLayout.vue'
2024-07-10 04:22:41 +00:00
import { Role, ComplexPermission } from '@/utils/permission/type'
2023-10-13 08:11:54 +00:00
const settingRouter = {
path: '/setting',
name: 'setting',
2024-07-16 09:32:27 +00:00
meta: { icon: 'Setting', title: '系统管理', permission: 'SETTING:READ' },
2024-05-20 09:50:14 +00:00
redirect: () => {
if (hasPermission(new Role('ADMIN'), 'AND')) {
return '/user'
}
return '/team'
},
2023-10-16 10:58:51 +00:00
component: Layout,
children: [
{
2024-03-20 02:38:59 +00:00
path: '/user',
name: 'user',
meta: {
icon: 'User',
iconActive: 'UserFilled',
title: '用户管理',
activeMenu: '/setting',
parentPath: '/setting',
parentName: 'setting',
permission: new Role('ADMIN')
2024-03-20 02:38:59 +00:00
},
component: () => import('@/views/user-manage/index.vue')
},
{
path: '/team',
name: 'team',
2023-11-07 07:30:15 +00:00
meta: {
icon: 'app-team',
2023-12-04 03:18:12 +00:00
iconActive: 'app-team-active',
2024-03-20 07:01:42 +00:00
title: '团队成员',
2024-03-20 02:38:59 +00:00
activeMenu: '/setting',
2023-11-07 07:30:15 +00:00
parentPath: '/setting',
parentName: 'setting'
},
2024-03-20 02:38:59 +00:00
component: () => import('@/views/team/index.vue')
2023-11-15 09:42:31 +00:00
},
{
path: '/template',
name: 'template',
meta: {
2023-12-04 03:18:12 +00:00
icon: 'app-template',
iconActive: 'app-template-active',
2024-03-20 07:01:42 +00:00
title: '模型设置',
2023-11-15 09:42:31 +00:00
activeMenu: '/setting',
parentPath: '/setting',
parentName: 'setting'
},
component: () => import('@/views/template/index.vue')
2024-03-20 07:01:42 +00:00
},
{
2024-07-09 09:50:37 +00:00
path: '/system',
name: 'system',
2024-03-20 07:01:42 +00:00
meta: {
2024-07-09 09:50:37 +00:00
icon: 'app-setting',
iconActive: 'app-setting-active',
2024-07-16 09:32:27 +00:00
title: '系统管理',
2024-03-20 07:01:42 +00:00
activeMenu: '/setting',
parentPath: '/setting',
parentName: 'setting',
permission: new Role('ADMIN')
},
2024-07-09 09:50:37 +00:00
children: [
{
path: '/system/theme',
name: 'theme',
meta: {
title: '外观设置',
activeMenu: '/setting',
parentPath: '/setting',
parentName: 'setting',
2024-07-10 04:22:41 +00:00
permission: new ComplexPermission(['ADMIN'], ['x-pack'], 'AND')
2024-07-09 09:50:37 +00:00
},
component: () => import('@/views/theme/index.vue')
},
{
path: '/system/authentication',
name: 'authentication',
meta: {
title: '登录认证',
activeMenu: '/setting',
parentPath: '/setting',
parentName: 'setting',
2024-07-10 04:22:41 +00:00
permission: new ComplexPermission(['ADMIN'], ['x-pack'], 'AND')
2024-07-09 09:50:37 +00:00
},
component: () => import('@/views/authentication/index.vue')
},
{
path: '/system/email',
name: 'email',
meta: {
title: '邮箱配置',
activeMenu: '/setting',
parentPath: '/setting',
parentName: 'setting',
permission: new Role('ADMIN')
},
component: () => import('@/views/email/index.vue')
}
]
2023-10-16 10:58:51 +00:00
}
]
2023-10-13 08:11:54 +00:00
}
export default settingRouter