exception.ts 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. import { RouteRecordRaw } from 'vue-router';
  2. import { Layout } from '@/router/constant';
  3. import { ExclamationCircleOutlined } from '@vicons/antd';
  4. import { renderIcon } from '@/utils/index';
  5. /**
  6. * @param name 路由名称, 必须设置,且不能重名
  7. * @param meta 路由元信息(路由附带扩展信息)
  8. * @param redirect 重定向地址, 访问这个路由时,自定进行重定向
  9. * @param meta.disabled 禁用整个菜单
  10. * @param meta.title 菜单名称
  11. * @param meta.icon 菜单图标
  12. * @param meta.keepAlive 缓存该路由
  13. * @param meta.sort 排序越小越排前
  14. *
  15. * */
  16. const routes: Array<RouteRecordRaw> = [
  17. {
  18. path: '/exception',
  19. name: 'Exception',
  20. redirect: '/exception/403',
  21. component: Layout,
  22. meta: {
  23. title: '异常页面',
  24. icon: renderIcon(ExclamationCircleOutlined),
  25. sort: 3,
  26. },
  27. children: [
  28. {
  29. path: '403',
  30. name: 'exception-403',
  31. meta: {
  32. title: '403',
  33. },
  34. component: () => import('@/views/exception/403.vue'),
  35. },
  36. {
  37. path: '404',
  38. name: 'exception-404',
  39. meta: {
  40. title: '404',
  41. },
  42. component: () => import('@/views/exception/404.vue'),
  43. },
  44. {
  45. path: '500',
  46. name: 'exception-500',
  47. meta: {
  48. title: '500',
  49. },
  50. component: () => import('@/views/exception/500.vue'),
  51. },
  52. ],
  53. },
  54. ];
  55. export default routes;