index.js 4.9 KB

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