router.ts 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. import { createRouter, createWebHashHistory, RouteRecordRaw } from "vue-router";
  2. import ProfileLayout from "./layout";
  3. const routes: Array<RouteRecordRaw> = [
  4. // {
  5. // path: "/",
  6. // name: "homePage",
  7. // meta: {
  8. // needAuth: true,
  9. // },
  10. // component: () => import("./Home"),
  11. // },
  12. {
  13. path: "/create/:id",
  14. name: "create",
  15. meta: {
  16. needAuth: true,
  17. },
  18. component: () => import("./CreateMat"),
  19. },
  20. {
  21. path: "/",
  22. name: "workbench",
  23. meta: {
  24. needAuth: true,
  25. },
  26. redirect: "/workbench/promotion",
  27. component: ProfileLayout,
  28. children: [
  29. {
  30. path: "/workbench/promotion",
  31. name: "promotion",
  32. component: () => import("./Promotion2"),
  33. },
  34. {
  35. path: "/workstage/material",
  36. name: "material",
  37. component: () => import("./Material2"),
  38. },
  39. {
  40. path: "/settings",
  41. name: "settings",
  42. component: () => import("./Settings"),
  43. },
  44. ],
  45. },
  46. {
  47. path: "/login",
  48. name: "login",
  49. component: () => import("@queenjs-modules/auth/components/Login"),
  50. },
  51. {
  52. path: "/forget",
  53. name: "forget",
  54. component: () => import("@queenjs-modules/auth/components/Forget"),
  55. },
  56. {
  57. path: "/register",
  58. name: "register",
  59. component: () => import("@queenjs-modules/auth/components/Register"),
  60. },
  61. ];
  62. const router = createRouter({
  63. history: createWebHashHistory(),
  64. routes,
  65. });
  66. export default router;