index.js 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. import { createRouter, createWebHashHistory } from 'vue-router'
  2. const constantRoutes = [
  3. {
  4. path: '/login',
  5. name: 'Login',
  6. meta: { title: 'Login' },
  7. component: () => import('@/views/login/login.vue'),
  8. },
  9. {
  10. path: '/404',
  11. component: () => import('@/views/error-page/404.vue'),
  12. hidden: true,
  13. },
  14. {
  15. path: '/oauth/:code',
  16. component: () => import('@/views/oauth/login.vue'),
  17. hidden: true,
  18. },
  19. {
  20. path: '/oauth/bind/:code',
  21. component: () => import('@/views/oauth/bind.vue'),
  22. hidden: true,
  23. },
  24. ]
  25. export const asyncRoutes = [
  26. // {
  27. // path: '/',
  28. // name: 'Index',
  29. // redirect: '/Home',
  30. // meta: { title: '首页', icon: 'house' },
  31. // component: () => import('@/layout/index.vue'),
  32. // children: [
  33. // {
  34. // path: '/Home',
  35. // name: 'Home',
  36. // meta: { title: '首页', icon: 'house' },
  37. // component: () => import('@/views/index/index.vue'),
  38. // },
  39. //
  40. // ],
  41. // },
  42. {
  43. path: '/my',
  44. name: 'My',
  45. redirect: '/my/info',
  46. meta: { title: 'My', icon: 'UserFilled' },
  47. component: () => import('@/layout/index.vue'),
  48. children: [
  49. {
  50. path: '/',
  51. name: 'MyInfo',
  52. meta: { title: 'Info', icon: 'User' /*keepAlive: true*/ },
  53. component: () => import('@/views/my/info.vue'),
  54. },
  55. {
  56. path: 'address_book',
  57. name: 'MyAddressBookList',
  58. meta: { title: 'AddressBooks', icon: 'Notebook' /*keepAlive: true*/ },
  59. component: () => import('@/views/my/address_book/index.vue'),
  60. },
  61. {
  62. path: 'tag',
  63. name: 'MyTagList',
  64. meta: { title: 'Tags', icon: 'CollectionTag' /*keepAlive: true*/ },
  65. component: () => import('@/views/my/tag/index.vue'),
  66. },
  67. ],
  68. },
  69. {
  70. path: '/user',
  71. name: 'User',
  72. redirect: '/user/index',
  73. meta: { title: 'System', icon: 'Setting' },
  74. component: () => import('@/layout/index.vue'),
  75. children: [
  76. {
  77. path: 'peer',
  78. name: 'Peer',
  79. meta: { title: 'PeerManage', icon: 'Monitor' /*keepAlive: true*/ },
  80. component: () => import('@/views/peer/index.vue'),
  81. },
  82. {
  83. path: 'group',
  84. name: 'UserGroup',
  85. meta: { title: 'GroupManage', icon: 'ChatRound' /*keepAlive: true*/ },
  86. component: () => import('@/views/group/index.vue'),
  87. },
  88. {
  89. path: 'index',
  90. name: 'UserList',
  91. meta: { title: 'UserManage', icon: 'User' /*keepAlive: true*/ },
  92. component: () => import('@/views/user/index.vue'),
  93. },
  94. {
  95. path: 'add',
  96. name: 'UserAdd',
  97. meta: { title: 'UserAdd', hide: true },
  98. component: () => import('@/views/user/edit.vue'),
  99. },
  100. {
  101. path: 'edit/:id',
  102. name: 'UserEdit',
  103. meta: { title: 'UserEdit', hide: true },
  104. component: () => import('@/views/user/edit.vue'),
  105. },
  106. {
  107. path: 'addressBook',
  108. name: 'UserAddressBook',
  109. meta: { title: 'AddressBookManage', icon: 'Notebook' /*keepAlive: true*/ },
  110. component: () => import('@/views/address_book/index.vue'),
  111. },
  112. {
  113. path: 'tag',
  114. name: 'UserTag',
  115. meta: { title: 'TagsManage', icon: 'CollectionTag' /*keepAlive: true*/ },
  116. component: () => import('@/views/tag/index.vue'),
  117. },
  118. {
  119. path: '/oauth',
  120. name: 'Oauth',
  121. meta: { title: 'OauthManage', icon: 'Link' /*keepAlive: true*/ },
  122. component: () => import('@/views/oauth/index.vue'),
  123. },
  124. {
  125. path: '/loginLog',
  126. name: 'LoginLog',
  127. meta: { title: 'LoginLog', icon: 'List' /*keepAlive: true*/ },
  128. component: () => import('@/views/login/log.vue'),
  129. },
  130. {
  131. path: '/auditConn',
  132. name: 'AuditConn',
  133. meta: { title: 'AuditConnLog', icon: 'Tickets' /*keepAlive: true*/ },
  134. component: () => import('@/views/audit/connList.vue'),
  135. },
  136. {
  137. path: '/auditFile',
  138. name: 'AuditFile',
  139. meta: { title: 'AuditFileLog', icon: 'Files' /*keepAlive: true*/ },
  140. component: () => import('@/views/audit/fileList.vue'),
  141. },
  142. ],
  143. },
  144. ]
  145. export const lastRoutes = [
  146. { path: '/:catchAll(.*)', redirect: '/404', meta: { hide: true } },
  147. ]
  148. export const router = createRouter({
  149. history: createWebHashHistory(),
  150. routes: constantRoutes,
  151. })