routes.js 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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: "HomePage",
  16. component: () => import("src/pages/home/HomePage.vue"),
  17. meta: { requireAuth: true },
  18. },
  19. {
  20. path: "/dashboard",
  21. name: "DashboardPage",
  22. component: () => import("pages/dashboard/DashboardPage.vue"),
  23. meta: {
  24. title: { value: "Dashboard" },
  25. description: { value: "page.system-dashboard.description", translate: true },
  26. requireAuth: true,
  27. requiredPermission: "dashboard",
  28. breadcrumbs: [{ name: "DashboardPage", title: "Dashboard" }],
  29. },
  30. },
  31. {
  32. path: "/versions",
  33. name: "SystemVersionsPage",
  34. component: () => import("pages/version/SystemVersionsPage.vue"),
  35. meta: {
  36. title: { value: "ui.navigation.versions", translate: true },
  37. description: { value: "page.versions.description", translate: true },
  38. requireAuth: true,
  39. breadcrumbs: [{ name: "SystemVersionsPage", title: "ui.navigation.versions", translate: true }],
  40. },
  41. },
  42. ...sub_routes,
  43. ],
  44. },
  45. {
  46. path: "/login",
  47. component: () => import("layouts/LoginLayout.vue"),
  48. children: [
  49. {
  50. path: "",
  51. name: "LoginPage",
  52. component: () => import("pages/login/LoginPage.vue"),
  53. meta: { title: "Login" },
  54. },
  55. {
  56. path: "/recuperar-senha",
  57. name: "ForgotPasswordPage",
  58. component: () => import("pages/login/ForgotPasswordPage.vue"),
  59. meta: { title: "Recuperar Senha" },
  60. },
  61. {
  62. path: "/verificar-email",
  63. name: "VerifyEmailPage",
  64. component: () => import("pages/login/VerifyEmailPage.vue"),
  65. meta: { title: "Verifique seu E-mail" },
  66. },
  67. {
  68. path: "/digitar-codigo",
  69. name: "VerifyCodePage",
  70. component: () => import("pages/login/VerifyCodePage.vue"),
  71. meta: { title: "Digite o Código" },
  72. },
  73. {
  74. path: "/nova-senha",
  75. name: "ResetPasswordPage",
  76. component: () => import("pages/login/ResetPasswordPage.vue"),
  77. meta: { title: "Nova Senha" },
  78. },
  79. ],
  80. },
  81. {
  82. path: "/:catchAll(.*)*",
  83. component: () => import("pages/ErrorNotFound.vue"),
  84. },
  85. ];
  86. export default routes;