index.ts 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. import { createRouter, createWebHistory } from "vue-router";
  2. import RouterComponent from '@/components/RouterComponent.vue';
  3. import { useMainStore } from "@/stores/main";
  4. const router = createRouter({
  5. history: createWebHistory(import.meta.env.BASE_URL),
  6. routes: [
  7. {
  8. path: '/',
  9. name: '/',
  10. component: () => import(/* webpackChunkName: "start" */ '@/views/main/Start.vue'),
  11. children: [
  12. {
  13. path: 'login',
  14. name: 'login',
  15. // route level code-splitting
  16. // this generates a separate chunk (about.[hash].js) for this route
  17. // which is lazy-loaded when the route is visited.
  18. component: () => import(/* webpackChunkName: "login" */ '@/views/Login.vue'),
  19. },
  20. {
  21. path: 'signup',
  22. name: 'signup',
  23. component: () => import(/* webpackChunkName: "login" */ '@/views/Signup.vue'),
  24. },
  25. {
  26. path: 'recover-password',
  27. name: 'recover-password',
  28. component: () => import(/* webpackChunkName: "recover-password" */ '@/views/PasswordRecovery.vue'),
  29. },
  30. {
  31. path: 'reset-password',
  32. name: 'reset-password',
  33. component: () => import(/* webpackChunkName: "reset-password" */ '@/views/ResetPassword.vue'),
  34. },
  35. {
  36. path: 'qrcode',
  37. name: 'qrcode',
  38. component: () => import(/* webpackChunkName: "reset-password" */ '@/views/Qrcode.vue'),
  39. },
  40. {
  41. path: 'yt-views',
  42. name: 'yt-views',
  43. component: () => import('@/views/YTViews.vue'),
  44. },
  45. {
  46. path: 'test-yt-views',
  47. name: 'test-yt-views',
  48. component: () => import('@/views/TestYTViews.vue'),
  49. },
  50. {
  51. path: 'main',
  52. name: 'main',
  53. component: () => import(/* webpackChunkName: "main" */ '@/views/main/Main.vue'),
  54. children: [
  55. {
  56. path: 'dashboard',
  57. name: 'dashboard',
  58. component: () => import(/* webpackChunkName: "main-dashboard" */ '@/views/main/Dashboard.vue'),
  59. },
  60. {
  61. path: 'make-video',
  62. name: 'make-video',
  63. component: () => import('@/views/main/Upload.vue'),
  64. },
  65. {
  66. path: 'make-article',
  67. name: 'make-article',
  68. component: () => import('@/views/main/Article.vue'),
  69. },
  70. {
  71. path: 'make-image',
  72. name: 'make-image',
  73. component: () => import('@/views/main/Image.vue'),
  74. },
  75. {
  76. path: 'progress',
  77. name: 'progress',
  78. component: () => import('@/views/main/Progress.vue'),
  79. },
  80. // {
  81. // path: 'yt-views',
  82. // name: 'yt-views',
  83. // component: () => import('@/views/main/YTViews.vue'),
  84. // },
  85. {
  86. path: 'profile',
  87. name: 'profile',
  88. component: RouterComponent,
  89. redirect: "/main/profile/view",
  90. children: [
  91. {
  92. path: 'view',
  93. name: 'view',
  94. component: () => import(
  95. /* webpackChunkName: "main-profile" */ '@/views/main/profile/UserProfile.vue'),
  96. },
  97. {
  98. path: 'edit',
  99. name: 'edit',
  100. component: () => import(
  101. /* webpackChunkName: "main-profile-edit" */ '@/views/main/profile/UserProfileEdit.vue'),
  102. },
  103. {
  104. path: 'password',
  105. name: 'password',
  106. component: () => import(
  107. /* webpackChunkName: "main-profile-password" */ '@/views/main/profile/UserProfileEditPassword.vue'),
  108. },
  109. ],
  110. },
  111. {
  112. path: 'admin',
  113. name: 'admin',
  114. component: () => import(/* webpackChunkName: "main-admin" */ '@/views/main/admin/Admin.vue'),
  115. redirect: '/main/admin/users/all',
  116. children: [
  117. {
  118. path: 'users',
  119. name: 'users',
  120. redirect: '/main/admin/users/all',
  121. },
  122. {
  123. path: 'users/all',
  124. name: 'all-users',
  125. component: () => import(
  126. /* webpackChunkName: "main-admin-users" */ '@/views/main/admin/AdminUsers.vue'),
  127. },
  128. {
  129. path: 'users/edit/:id',
  130. name: 'main-admin-users-edit',
  131. component: () => import(
  132. /* webpackChunkName: "main-admin-users-edit" */ '@/views/main/admin/EditUser.vue'),
  133. },
  134. {
  135. path: 'users/create',
  136. name: 'main-admin-users-create',
  137. component: () => import(
  138. /* webpackChunkName: "main-admin-users-create" */ '@/views/main/admin/CreateUser.vue'),
  139. },
  140. {
  141. path: 'test-celery',
  142. name: 'test-celery',
  143. component: () => import(
  144. /* webpackChunkName: "main-admin-users-create" */ '@/views/main/admin/TestCelery.vue'),
  145. },
  146. {
  147. path: 'test-ecpay',
  148. name: 'test-ecpay',
  149. component: () => import(
  150. /* webpackChunkName: "main-admin-users-create" */ '@/views/main/admin/TestECPay.vue'),
  151. },
  152. ],
  153. },
  154. ],
  155. },
  156. ]
  157. },
  158. ],
  159. });
  160. export default router;