exception.ts 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. import type { AppRouteModule } from '/@/router/types';
  2. import { PAGE_LAYOUT_COMPONENT } from '/@/router/constant';
  3. import { ExceptionEnum } from '/@/enums/exceptionEnum';
  4. const ExceptionPage = () => import('/@/views/sys/exception/Exception');
  5. export default {
  6. layout: {
  7. path: '/exception',
  8. name: 'ExceptionPage',
  9. component: PAGE_LAYOUT_COMPONENT,
  10. redirect: '/exception/404',
  11. meta: {
  12. icon: 'ant-design:exception-outlined',
  13. title: '异常页',
  14. },
  15. },
  16. routes: [
  17. {
  18. path: '/404',
  19. name: 'PageNotFound',
  20. component: ExceptionPage,
  21. props: {
  22. status: ExceptionEnum.PAGE_NOT_FOUND,
  23. },
  24. meta: {
  25. title: '404',
  26. afterCloseLoading: true,
  27. },
  28. },
  29. {
  30. path: '/500',
  31. name: 'ServiceError',
  32. component: ExceptionPage,
  33. props: {
  34. status: ExceptionEnum.ERROR,
  35. },
  36. meta: {
  37. title: '500',
  38. afterCloseLoading: true,
  39. },
  40. },
  41. {
  42. path: '/net-work-error',
  43. name: 'NetWorkError',
  44. component: ExceptionPage,
  45. props: {
  46. status: ExceptionEnum.NET_WORK_ERROR,
  47. },
  48. meta: {
  49. title: '网络错误',
  50. afterCloseLoading: true,
  51. },
  52. },
  53. {
  54. path: '/page-time-out',
  55. name: 'PageTimeOut',
  56. component: ExceptionPage,
  57. props: {
  58. status: ExceptionEnum.PAGE_TIMEOUT,
  59. },
  60. meta: {
  61. title: '页面超时',
  62. afterCloseLoading: true,
  63. },
  64. },
  65. {
  66. path: '/not-data',
  67. name: 'NotData',
  68. component: ExceptionPage,
  69. props: {
  70. status: ExceptionEnum.PAGE_NOT_DATA,
  71. },
  72. meta: {
  73. title: '无数据',
  74. afterCloseLoading: true,
  75. },
  76. },
  77. ],
  78. } as AppRouteModule;