admin-vben5/apps/antd-view/src/router/routes/_essential.ts

86 lines
2.0 KiB
TypeScript
Raw Normal View History

2024-05-19 21:20:42 +08:00
import type { RouteRecordRaw } from 'vue-router';
2024-06-01 23:15:29 +08:00
import { AuthPageLayoutType } from '@/layouts';
2024-05-19 21:20:42 +08:00
import { Fallback } from '@vben/common-ui';
2024-06-01 22:17:52 +08:00
import { $t } from '@vben/locales';
2024-05-19 21:20:42 +08:00
2024-06-01 22:17:52 +08:00
import Login from '@/views/_essential/authentication/login.vue';
/** 基本路由,这些路由是必须存在的 */
const essentialRoutes: RouteRecordRaw[] = [
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: {
ignoreAccess: true,
2024-06-01 22:17:52 +08:00
title: $t('page.login'),
2024-05-19 21:20:42 +08:00
},
},
{
name: 'CodeLogin',
path: 'code-login',
2024-06-01 22:17:52 +08:00
component: () =>
import('@/views/_essential/authentication/code-login.vue'),
2024-05-19 21:20:42 +08:00
meta: {
ignoreAccess: true,
2024-06-01 22:17:52 +08:00
title: $t('page.code-login'),
2024-05-19 21:20:42 +08:00
},
},
{
name: 'QrCodeLogin',
path: 'qrcode-login',
2024-06-01 22:17:52 +08:00
component: () =>
import('@/views/_essential/authentication/qrcode-login.vue'),
2024-05-19 21:20:42 +08:00
meta: {
ignoreAccess: true,
2024-06-01 22:17:52 +08:00
title: $t('page.qrcode-login'),
2024-05-19 21:20:42 +08:00
},
},
{
name: 'ForgetPassword',
path: 'forget-password',
2024-06-01 22:17:52 +08:00
component: () =>
import('@/views/_essential/authentication/forget-password.vue'),
2024-05-19 21:20:42 +08:00
meta: {
ignoreAccess: true,
2024-06-01 22:17:52 +08:00
title: $t('page.forget-password'),
2024-05-19 21:20:42 +08:00
},
},
{
name: 'Register',
path: 'register',
2024-06-01 22:17:52 +08:00
component: () =>
import('@/views/_essential/authentication/register.vue'),
2024-05-19 21:20:42 +08:00
meta: {
ignoreAccess: true,
2024-06-01 22:17:52 +08:00
title: $t('page.register'),
2024-05-19 21:20:42 +08:00
},
},
],
},
// 错误页
{
component: Fallback,
meta: {
hideInBreadcrumb: true,
hideInMenu: true,
hideInTab: true,
2024-06-01 22:17:52 +08:00
ignoreAccess: true,
2024-05-19 21:20:42 +08:00
title: 'Fallback',
},
name: 'Fallback',
path: '/:path(.*)*',
},
];
2024-06-01 22:17:52 +08:00
export { essentialRoutes };