basic.ts 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. import type { AppRouteRecordRaw } from '@/router/types';
  2. import { t } from '@/hooks/web/useI18n';
  3. import { REDIRECT_NAME, LAYOUT, EXCEPTION_COMPONENT, PAGE_NOT_FOUND_NAME } from '@/router/constant';
  4. // 404 on a page
  5. export const PAGE_NOT_FOUND_ROUTE: AppRouteRecordRaw = {
  6. path: '/:path(.*)*',
  7. name: PAGE_NOT_FOUND_NAME,
  8. component: LAYOUT,
  9. meta: {
  10. title: 'ErrorPage',
  11. hideBreadcrumb: true,
  12. hideMenu: true,
  13. },
  14. children: [
  15. {
  16. path: '/:path(.*)*',
  17. name: PAGE_NOT_FOUND_NAME,
  18. component: EXCEPTION_COMPONENT,
  19. meta: {
  20. title: 'ErrorPage',
  21. hideBreadcrumb: true,
  22. hideMenu: true,
  23. },
  24. },
  25. ],
  26. };
  27. export const REDIRECT_ROUTE: AppRouteRecordRaw = {
  28. path: '/redirect',
  29. component: LAYOUT,
  30. name: 'RedirectTo',
  31. meta: {
  32. title: REDIRECT_NAME,
  33. hideBreadcrumb: true,
  34. hideMenu: true,
  35. },
  36. children: [
  37. {
  38. path: '/redirect/:path(.*)/:_redirect_type(.*)/:_origin_params(.*)?',
  39. name: REDIRECT_NAME,
  40. component: () => import('@/views/sys/redirect/index.vue'),
  41. meta: {
  42. title: REDIRECT_NAME,
  43. hideBreadcrumb: true,
  44. },
  45. },
  46. ],
  47. };
  48. export const ERROR_LOG_ROUTE: AppRouteRecordRaw = {
  49. path: '/error-log',
  50. name: 'ErrorLog',
  51. component: LAYOUT,
  52. redirect: '/error-log/list',
  53. meta: {
  54. title: 'ErrorLog',
  55. hideBreadcrumb: true,
  56. hideChildrenInMenu: true,
  57. },
  58. children: [
  59. {
  60. path: 'list',
  61. name: 'ErrorLogList',
  62. component: () => import('@/views/sys/error-log/index.vue'),
  63. meta: {
  64. title: t('routes.basic.errorLogList'),
  65. hideBreadcrumb: true,
  66. currentActiveMenu: '/error-log',
  67. },
  68. },
  69. ],
  70. };