UnisKB/ui/src/router/routes.ts

55 lines
1.3 KiB
TypeScript
Raw Normal View History

2023-09-15 09:40:35 +00:00
import type { RouteRecordRaw } from 'vue-router'
2023-10-13 08:11:54 +00:00
import { Role } from '@/utils/permission/type'
const modules: any = import.meta.glob('./modules/*.ts', { eager: true })
const rolesRoutes: RouteRecordRaw[] = [...Object.keys(modules).map((key) => modules[key].default)]
2023-09-15 09:40:35 +00:00
export const routes: Array<RouteRecordRaw> = [
{
path: '/',
name: 'home',
2023-11-17 03:36:16 +00:00
redirect: '/application',
2024-05-20 09:50:14 +00:00
children: [...rolesRoutes]
2023-09-15 09:40:35 +00:00
},
2023-10-16 10:58:51 +00:00
2024-07-01 01:45:59 +00:00
// 高级编排
{
path: '/application/:id/workflow',
name: 'ApplicationWorkflow',
meta: { activeMenu: '/application' },
component: () => import('@/views/application-workflow/index.vue')
},
2023-11-29 09:34:45 +00:00
{
path: '/chat/:accessToken',
name: 'Chat',
component: () => import('@/views/chat/index.vue')
},
2023-09-15 09:40:35 +00:00
{
path: '/login',
name: 'login',
component: () => import('@/views/login/index.vue')
},
{
path: '/register',
name: 'register',
2023-10-12 08:36:16 +00:00
component: () => import('@/views/login/register/index.vue')
2023-09-15 09:40:35 +00:00
},
{
path: '/forgot_password',
name: 'forgot_password',
2023-10-12 08:36:16 +00:00
component: () => import('@/views/login/forgot-password/index.vue')
2023-09-15 09:40:35 +00:00
},
{
path: '/reset_password/:code/:email',
name: 'reset_password',
2023-10-12 08:36:16 +00:00
component: () => import('@/views/login/reset-password/index.vue')
2023-09-15 09:40:35 +00:00
},
{
path: '/:pathMatch(.*)',
name: '404',
component: () => import('@/views/404/index.vue')
}
]