routes.js 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. let sub_routes = [];
  2. const modules = import.meta.glob("./routes/*.route.js", { eager: true });
  3. // eslint-disable-next-line no-unused-vars
  4. Object.entries(modules).forEach(([path, definition]) => {
  5. sub_routes = sub_routes.concat(definition.default);
  6. });
  7. const routes = [
  8. {
  9. path: "/",
  10. component: () => import("layouts/MainLayout.vue"),
  11. meta: { requireAuth: true },
  12. children: [
  13. {
  14. path: "",
  15. name: "CarteirinhaPage",
  16. component: () => import("pages/associado/carteirinha/CarteirinhaPage.vue"),
  17. meta: {
  18. title: { value: "ui.navigation.carteirinha", translate: true },
  19. description: { value: "page.associado.carteirinha.description", translate: true },
  20. requireAuth: true,
  21. breadcrumbs: [{ name: "CarteirinhaPage", title: "ui.navigation.carteirinha", translate: true }],
  22. },
  23. },
  24. {
  25. path: "/versions",
  26. name: "SystemVersionsPage",
  27. component: () => import("pages/version/SystemVersionsPage.vue"),
  28. meta: {
  29. title: { value: "ui.navigation.versions", translate: true },
  30. description: { value: "page.versions.description", translate: true },
  31. requireAuth: true,
  32. breadcrumbs: [{ name: "SystemVersionsPage", title: "ui.navigation.versions", translate: true }],
  33. },
  34. },
  35. ...sub_routes,
  36. ],
  37. },
  38. {
  39. path: "/login",
  40. component: () => import("layouts/LoginLayout.vue"),
  41. children: [
  42. {
  43. path: "",
  44. name: "LoginPage",
  45. component: () => import("pages/login/LoginPage.vue"),
  46. meta: {
  47. title: "Login",
  48. },
  49. },
  50. ],
  51. },
  52. // Always leave this as last one,
  53. // but you can also remove it
  54. {
  55. path: "/:catchAll(.*)*",
  56. component: () => import("pages/ErrorNotFound.vue"),
  57. },
  58. ];
  59. export default routes;