UnisKB/ui/src/router/routes.ts

50 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-10-16 10:58:51 +00:00
component: () => import('@/layout/app-layout/index.vue'),
2023-11-10 09:18:00 +00:00
redirect: '/dataset',
2023-09-15 09:40:35 +00:00
children: [
2023-10-25 10:35:28 +00:00
// {
// path: '/first',
// name: 'first',
// meta: { icon: 'House', title: '首页' },
// component: () => import('@/views/first/index.vue')
// },
2023-10-13 08:11:54 +00:00
...rolesRoutes
2023-09-15 09:40:35 +00:00
]
},
2023-10-16 10:58:51 +00:00
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')
}
]