admin-vben5/apps/web-antd/src/router/routes/_essentials.ts

89 lines
2.1 KiB
TypeScript
Raw Normal View History

2024-05-19 21:20:42 +08:00
import type { RouteRecordRaw } from 'vue-router';
2024-06-08 20:14:04 +08:00
import { DEFAULT_HOME_PATH } from '@vben/constants';
2024-06-01 22:17:52 +08:00
import { $t } from '@vben/locales';
2024-05-19 21:20:42 +08:00
2024-06-16 23:40:52 +08:00
import { AuthPageLayoutType } from '#/layouts';
import Login from '#/views/_essential/authentication/login.vue';
2024-06-01 22:17:52 +08:00
2024-06-08 20:14:04 +08:00
/** 全局404页面 */
const fallbackNotFoundRoute: RouteRecordRaw = {
2024-06-16 23:40:52 +08:00
component: () => import('#/views/_essential/fallback/not-found.vue'),
2024-06-08 20:14:04 +08:00
meta: {
hideInBreadcrumb: true,
hideInMenu: true,
hideInTab: true,
title: '404',
},
name: 'Fallback',
path: '/:path(.*)*',
};
2024-06-01 22:17:52 +08:00
/** 基本路由,这些路由是必须存在的 */
2024-06-08 19:49:06 +08:00
const essentialsRoutes: RouteRecordRaw[] = [
2024-06-08 20:14:04 +08:00
{
meta: {
title: 'Root',
},
name: 'Root',
path: '/',
redirect: DEFAULT_HOME_PATH,
},
2024-05-19 21:20:42 +08:00
{
2024-06-01 23:15:29 +08:00
component: AuthPageLayoutType,
2024-05-19 21:20:42 +08:00
meta: {
title: 'Authentication',
},
name: 'Authentication',
path: '/auth',
children: [
{
name: 'Login',
path: 'login',
2024-06-01 22:17:52 +08:00
component: Login,
2024-05-19 21:20:42 +08:00
meta: {
2024-06-08 20:14:04 +08:00
title: $t('page.essentials.login'),
2024-05-19 21:20:42 +08:00
},
},
{
name: 'CodeLogin',
path: 'code-login',
2024-06-01 22:17:52 +08:00
component: () =>
2024-06-16 23:40:52 +08:00
import('#/views/_essential/authentication/code-login.vue'),
2024-05-19 21:20:42 +08:00
meta: {
2024-06-08 20:14:04 +08:00
title: $t('page.essentials.code-login'),
2024-05-19 21:20:42 +08:00
},
},
{
name: 'QrCodeLogin',
path: 'qrcode-login',
2024-06-01 22:17:52 +08:00
component: () =>
2024-06-16 23:40:52 +08:00
import('#/views/_essential/authentication/qrcode-login.vue'),
2024-05-19 21:20:42 +08:00
meta: {
2024-06-08 20:14:04 +08:00
title: $t('page.essentials.qrcode-login'),
2024-05-19 21:20:42 +08:00
},
},
{
name: 'ForgetPassword',
path: 'forget-password',
2024-06-01 22:17:52 +08:00
component: () =>
2024-06-16 23:40:52 +08:00
import('#/views/_essential/authentication/forget-password.vue'),
2024-05-19 21:20:42 +08:00
meta: {
2024-06-08 20:14:04 +08:00
title: $t('page.essentials.forget-password'),
2024-05-19 21:20:42 +08:00
},
},
{
name: 'Register',
path: 'register',
2024-06-01 22:17:52 +08:00
component: () =>
2024-06-16 23:40:52 +08:00
import('#/views/_essential/authentication/register.vue'),
2024-05-19 21:20:42 +08:00
meta: {
2024-06-08 20:14:04 +08:00
title: $t('page.essentials.register'),
2024-05-19 21:20:42 +08:00
},
},
],
},
];
2024-06-08 20:14:04 +08:00
export { essentialsRoutes, fallbackNotFoundRoute };