index.js 5.0 KB

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