Adicione primeiros dados da tabela

This commit is contained in:
LeoMortari
2025-09-18 18:48:46 -03:00
parent 2e65d38222
commit 31fb7addb5
8 changed files with 102 additions and 76 deletions

View File

@@ -73,35 +73,37 @@ const hasPermission = (requiredPermissions = []) => {
);
};
router.beforeEach((to, from, next) => {
if (to.meta.title) {
document.title = to.meta.title;
}
// router.beforeEach((to, from, next) => {
// if (to.meta.title) {
// document.title = to.meta.title;
// }
// if (to.matched.some((record) => record.meta.requiresAuth)) {
if (!isAuthenticated()) {
next({
path: "/login",
query: { redirect: to.fullPath },
});
// console.log(to, from);
return;
}
// // if (to.matched.some((record) => record.meta.requiresAuth)) {
// if (!isAuthenticated()) {
// next({
// path: "/login",
// });
// const requiredPermissions = to.meta.permissions || [];
// return;
// }
// if (requiredPermissions.length > 0 && !hasPermission(requiredPermissions)) {
// next({ path: "/unauthorized" });
// // const requiredPermissions = to.meta.permissions || [];
// return;
// }
// }
// // if (requiredPermissions.length > 0 && !hasPermission(requiredPermissions)) {
// // next({ path: "/unauthorized" });
// if (to.matched.some((record) => record.meta.guest) && isAuthenticated()) {
// next({ path: "/" });
// // return;
// // }
// // }
// return;
// }
// // if (to.matched.some((record) => record.meta.guest) && isAuthenticated()) {
// // next({ path: "/" });
next();
});
// // return;
// // }
// next();
// return;
// });