ปรับ redirect คนกรอกข้อมูลทะเบียนประวัติ

This commit is contained in:
Warunee Tamkoo 2024-02-06 12:15:32 +07:00
parent 429e2bde32
commit 67d136c2bb

View file

@ -93,7 +93,11 @@ router.beforeEach((to, from, next) => {
} else {
// keycloak.updateToken(60);
const role = keycloak.tokenParsed?.role;
if (role.includes(to.meta.Role)) {
// ถ้าเป็นคนกรอกข้อมูล
if (role.includes("keyregistry") && to.meta.Role != "registry") {
next({ path: "/registry" });
} else if (role.includes(to.meta.Role)) {
next();
} else {
next({ path: "" });