staticRouter.ts 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. import { RouteRecordRaw } from 'vue-router'
  2. export const staticRouter: RouteRecordRaw[] = [
  3. {
  4. path: '/',
  5. redirect: '/index'
  6. },
  7. {
  8. path: '/index',
  9. name: 'Index',
  10. component: () => import('@/views/Index.vue'),
  11. meta: {
  12. title: '首页'
  13. },
  14. children: [
  15. {
  16. path: '/home',
  17. name: 'Home',
  18. component: () => import('@/views/home/index.vue'),
  19. meta: {
  20. title: '首页'
  21. }
  22. },
  23. {
  24. path: '/roles',
  25. name: 'Roles',
  26. component: () => import('@/views/account/roles/Roles.vue'),
  27. meta: {
  28. title: '角色管理'
  29. }
  30. },
  31. {
  32. path: '/users',
  33. name: 'Users',
  34. component: () => import('@/views/account/users/Users.vue'),
  35. meta: {
  36. title: '账户管理'
  37. }
  38. },
  39. {
  40. path: '/salary',
  41. name: 'Salary',
  42. component: () => import('@/views/salary/Salary.vue'),
  43. meta: {
  44. title: '薪资管理'
  45. }
  46. },
  47. {
  48. path: '/salaryCount',
  49. name: 'SalaryCount',
  50. component: () => import('@/views/salary/SalaryCount.vue'),
  51. meta: {
  52. title: '薪资统计'
  53. }
  54. },
  55. {
  56. path: '/salaryMy',
  57. name: 'SalaryMy',
  58. component: () => import('@/views/salary/SalaryMy.vue'),
  59. meta: {
  60. title: '我的薪资'
  61. }
  62. }
  63. ]
  64. },
  65. {
  66. path: '/login',
  67. name: 'login',
  68. component: () => import('@/views/Login.vue'),
  69. meta: {
  70. title: '登录'
  71. }
  72. }
  73. ]
  74. export const errorRouter = [
  75. {
  76. path: '/404',
  77. name: '404',
  78. component: () => import('@/components/ErrorMessage/404.vue'),
  79. meta: {
  80. title: '404页面'
  81. }
  82. },
  83. {
  84. path: '/:pathMatch(.*)*',
  85. name: 'notFound',
  86. redirect: { name: '404' }
  87. }
  88. ]