Allowance check

This commit is contained in:
ISMAIL MASSERAN
2026-04-14 02:34:00 +00:00
parent 0c4d200839
commit 3775c4a876
100 changed files with 81493 additions and 3226 deletions
+14
View File
@@ -18,6 +18,20 @@ const router = new VueRouter({
routes
});
router.beforeEach(function (to, from, next) {
if (!to.path.startsWith('/admin') || to.name === 'Admin Login') {
return next();
}
if (!localStorage.getItem('Access Token')) {
return next();
}
var role = localStorage.getItem('admin_role');
if (role === '3' && to.name !== 'Kehadiran Calon') {
return next({ name: 'Kehadiran Calon', replace: true });
}
next();
});
const app = new Vue({
router
}).$mount('#app');