邃芒慧影、口播(PC) https://neuver.metavatar.cc/
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.
 
 
 
 

231 rinda
5.0 KiB

  1. import { createRouter, createWebHashHistory, RouteRecordRaw } from "vue-router";
  2. import { getCurrentInstance } from "vue";
  3. export const Layout = () => import("@/layout/index.vue");
  4. // 静态路由
  5. export const constantRoutes: RouteRecordRaw[] = [
  6. // 登录
  7. {
  8. path: "/login",
  9. component: () => import("@/views/login/index.vue"),
  10. meta: { hidden: true },
  11. name:'login'
  12. },
  13. {
  14. path: "/signSucceed",
  15. component: () => import("@/views/signSucceed/index.vue"),
  16. meta: { hidden: true },
  17. },
  18. // 创建视频
  19. {
  20. path: "/",
  21. component: Layout,
  22. redirect: "/createVideo",
  23. children: [
  24. {
  25. path: "createVideo",
  26. component: () => import("@/views/createVideo/index.vue"),
  27. name: "createVideo",
  28. meta: {
  29. title: "createVideo",
  30. icon: "homepage",
  31. affix: true,
  32. name: "createVideo.title",
  33. },
  34. },
  35. ],
  36. },
  37. // 视频列表
  38. {
  39. path: "/",
  40. component: Layout,
  41. redirect: "/myCreating",
  42. children: [
  43. {
  44. path: "myCreating",
  45. component: () => import("@/views/myCreating/index.vue"),
  46. name: "myCreating",
  47. meta: {
  48. title: "myCreating",
  49. icon: "homepage",
  50. affix: true,
  51. name: "myCreating.title",
  52. },
  53. },
  54. ],
  55. }, // 定制分身
  56. {
  57. path: "/",
  58. component: Layout,
  59. redirect: "/userModel",
  60. children: [
  61. {
  62. path: "userModel",
  63. component: () => import("@/views/userModel/index.vue"),
  64. name: "userModel",
  65. meta: {
  66. title: "userModel",
  67. icon: "homepage",
  68. affix: true,
  69. name: "userModel.title",
  70. },
  71. },
  72. ],
  73. }, // 定制声纹
  74. {
  75. path: "/",
  76. component: Layout,
  77. redirect: "/voiceModel",
  78. children: [
  79. {
  80. path: "voiceModel",
  81. component: () => import("@/views/voiceModel/index.vue"),
  82. name: "voiceModel",
  83. meta: {
  84. title: "voiceModel",
  85. icon: "homepage",
  86. affix: true,
  87. name: "voiceModel.title",
  88. },
  89. },
  90. ],
  91. }, {
  92. path: "/",
  93. component: Layout,
  94. redirect: "/myStore",
  95. children: [
  96. {
  97. path: "myStore",
  98. component: () => import("@/views/myStore/index.vue"),
  99. name: "myStore",
  100. meta: {
  101. title: "myStore",
  102. icon: "homepage",
  103. affix: true,
  104. name: "myStore.title",
  105. },
  106. },
  107. ],
  108. }, {
  109. path: "/",
  110. component: Layout,
  111. redirect: "/myRecharge",
  112. children: [
  113. {
  114. path: "/myRecharge",
  115. component: () => import("@/views/my/recharge.vue"),
  116. name: "myRecharge",
  117. meta: {
  118. title: "myRecharge",
  119. icon: "homepage",
  120. affix: true,
  121. name: "my.title",
  122. },
  123. },
  124. {
  125. path: "/coindeduc",
  126. component: () => import("@/views/my/coindeduc.vue"),
  127. name: "coindeduc",
  128. meta: {
  129. title: "coindeduc",
  130. icon: "homepage",
  131. affix: true,
  132. name: "my.title",
  133. },
  134. },
  135. ],
  136. },
  137. {
  138. path: "/",
  139. component: Layout,
  140. redirect: "/moveImg",
  141. children: [
  142. {
  143. path: "moveImg",
  144. component: () => import("@/views/moveImg/index.vue"),
  145. name: "moveImg",
  146. meta: {
  147. title: "moveImg",
  148. icon: "homepage",
  149. affix: true,
  150. name: "moveImg.title",
  151. },
  152. },
  153. ],
  154. },
  155. {
  156. path: "/",
  157. component: Layout,
  158. redirect: "/separation",
  159. children: [
  160. {
  161. path: "/separation",
  162. component: () => import("@/views/separation/index.vue"),
  163. name: "separation",
  164. meta: {
  165. title: "separation",
  166. icon: "homepage",
  167. affix: true,
  168. name: "separation.title",
  169. },
  170. },
  171. {
  172. path: "/voiceprint",
  173. component: () => import("@/views/voiceprint/index.vue"),
  174. name: "voiceprint",
  175. meta: {
  176. title: "voiceprint",
  177. icon: "homepage",
  178. affix: true,
  179. name: "separation.title",
  180. },
  181. },
  182. {
  183. path: "/privatization",
  184. component: () => import("@/views/privatization/index.vue"),
  185. name: "privatization",
  186. meta: {
  187. title: "privatization",
  188. icon: "homepage",
  189. affix: true,
  190. name: "separation.title",
  191. },
  192. },
  193. {
  194. path: "/api",
  195. component: () => import("@/views/api/index.vue"),
  196. name: "api",
  197. meta: {
  198. title: "api",
  199. icon: "homepage",
  200. affix: true,
  201. name: "separation.title",
  202. },
  203. },
  204. ],
  205. },
  206. ];
  207. /**
  208. * 创建路由
  209. */
  210. const router = createRouter({
  211. history: createWebHashHistory(),
  212. routes: constantRoutes as RouteRecordRaw[],
  213. // 刷新时,滚动条位置还原
  214. // 2023-5-23 添加平滑滚动 YWQ
  215. scrollBehavior: () => ({ behavior: "smooth", left: 0, top: 0 }),
  216. });
  217. /**
  218. * 重置路由
  219. */
  220. export function resetRouter() {
  221. router.replace({ path: "/login" });
  222. }
  223. export default router;