base.ts 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. import { RouteRecordRaw } from 'vue-router'
  2. import type { AppRouteRecordRaw } from '@/router/types';
  3. import { ErrorPage404, ErrorPage403, ErrorPage500, Layout } from '@/router/constant';
  4. import { PageEnum } from '@/enums/pageEnum'
  5. export const LoginRoute: RouteRecordRaw = {
  6. path: '/login',
  7. name: 'Login',
  8. component: () => import('@/views/login/index.vue'),
  9. meta: {
  10. title: '登录',
  11. },
  12. };
  13. export const HttpErrorPage: RouteRecordRaw[] = [
  14. {
  15. path: '/error/404',
  16. name: PageEnum.ERROR_PAGE_NAME_404,
  17. component: ErrorPage404,
  18. meta: {
  19. title: PageEnum.ERROR_PAGE_NAME_404,
  20. },
  21. },
  22. {
  23. path: '/error/403',
  24. name: PageEnum.ERROR_PAGE_NAME_403,
  25. component: ErrorPage403,
  26. meta: {
  27. title: PageEnum.ERROR_PAGE_NAME_403,
  28. },
  29. },
  30. {
  31. path: '/error/500',
  32. name: PageEnum.ERROR_PAGE_NAME_500,
  33. component: ErrorPage500,
  34. meta: {
  35. title: PageEnum.ERROR_PAGE_NAME_500,
  36. },
  37. },
  38. ]
  39. // 404 on a page
  40. export const ErrorPageRoute: AppRouteRecordRaw = {
  41. path: '/:path(.*)*',
  42. name: 'ErrorPage',
  43. component: ErrorPage404,
  44. meta: {
  45. title: PageEnum.ERROR_PAGE_NAME_404,
  46. hideBreadcrumb: true,
  47. }
  48. };
  49. export const RedirectRoute: AppRouteRecordRaw = {
  50. path: '/redirect',
  51. name: PageEnum.REDIRECT_NAME,
  52. component: Layout,
  53. meta: {
  54. title: PageEnum.REDIRECT_NAME,
  55. },
  56. children: [
  57. {
  58. path: '/redirect/:path(.*)',
  59. name: PageEnum.REDIRECT_NAME,
  60. component: () => import('@/views/redirect/index.vue'),
  61. meta: {
  62. title: PageEnum.REDIRECT_NAME,
  63. hideBreadcrumb: true,
  64. },
  65. },
  66. ],
  67. };