core.ts 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. import type { RouteRecordRaw } from 'vue-router';
  2. import { DEFAULT_HOME_PATH } from '@vben/constants';
  3. import { AuthPageLayout } from '#/layouts';
  4. import { $t } from '#/locales';
  5. import Login from '#/views/_core/authentication/login.vue';
  6. /** 全局404页面 */
  7. const fallbackNotFoundRoute: RouteRecordRaw = {
  8. component: () => import('#/views/_core/fallback/not-found.vue'),
  9. meta: {
  10. hideInBreadcrumb: true,
  11. hideInMenu: true,
  12. hideInTab: true,
  13. title: '404',
  14. },
  15. name: 'FallbackNotFound',
  16. path: '/:path(.*)*',
  17. };
  18. /** 基本路由,这些路由是必须存在的 */
  19. const coreRoutes: RouteRecordRaw[] = [
  20. {
  21. meta: {
  22. title: 'Root',
  23. },
  24. name: 'Root',
  25. path: '/',
  26. redirect: DEFAULT_HOME_PATH,
  27. },
  28. {
  29. component: AuthPageLayout,
  30. meta: {
  31. hideInTab: true,
  32. title: 'Authentication',
  33. },
  34. name: 'Authentication',
  35. path: '/auth',
  36. children: [
  37. {
  38. name: 'Login',
  39. path: 'login',
  40. component: Login,
  41. meta: {
  42. title: $t('page.auth.login'),
  43. },
  44. },
  45. {
  46. name: 'CodeLogin',
  47. path: 'code-login',
  48. component: () => import('#/views/_core/authentication/code-login.vue'),
  49. meta: {
  50. title: $t('page.auth.codeLogin'),
  51. },
  52. },
  53. {
  54. name: 'QrCodeLogin',
  55. path: 'qrcode-login',
  56. component: () =>
  57. import('#/views/_core/authentication/qrcode-login.vue'),
  58. meta: {
  59. title: $t('page.auth.qrcodeLogin'),
  60. },
  61. },
  62. {
  63. name: 'ForgetPassword',
  64. path: 'forget-password',
  65. component: () =>
  66. import('#/views/_core/authentication/forget-password.vue'),
  67. meta: {
  68. title: $t('page.auth.forgetPassword'),
  69. },
  70. },
  71. {
  72. name: 'Register',
  73. path: 'register',
  74. component: () => import('#/views/_core/authentication/register.vue'),
  75. meta: {
  76. title: $t('page.auth.register'),
  77. },
  78. },
  79. ],
  80. },
  81. ];
  82. export { coreRoutes, fallbackNotFoundRoute };