Feature/standardize ui display

This commit is contained in:
ISMAIL MASSERAN
2026-06-23 07:44:42 +00:00
parent a969d4bbcf
commit 378b00a1e6
25 changed files with 2883 additions and 54 deletions
@@ -47,6 +47,10 @@ export default {
}),
created: function () {
if (!this.util.isLogin()) {
this.$router.replace({ name: 'Voter Login' });
return;
}
this.refreshInfo();
},
@@ -81,7 +85,7 @@ export default {
axios.post(config.API + 'voter/logout')
.catch(function () { })
.finally(function () {
localStorage.clear();
vm.util.clearSession();
vm.$router.push({ name: 'Voter Login' });
});
},
@@ -105,10 +109,14 @@ export default {
vm.data.result = response.data.result;
})
.catch(error => {
vm.loading = false;
if (vm.util.showResult(error, 'error') == 401) {
vm.$router.push({ name: 'Voter Login' });
var status = error.response ? error.response.status : 500;
if (status === 401) {
vm.util.clearSession();
vm.$router.replace({ name: 'Voter Login' });
return;
}
vm.loading = false;
vm.util.showResult(error, 'error');
});
}
}