[WIP] Фикс удаления токена

This commit is contained in:
megavrilinvv
2022-12-07 13:50:27 +03:00
parent 0e352544e8
commit 463a54b7e3
3 changed files with 5 additions and 5 deletions

View File

@@ -55,7 +55,7 @@ export default {
}, },
methods: { methods: {
logout() { logout() {
localStorage.clear(); localStorage.removeItem("tokenAccess");
this.$router.push("/login"); this.$router.push("/login");
}, },
}, },

View File

@@ -107,8 +107,8 @@ export default {
fetchEmployeesData() { fetchEmployeesData() {
fetchWrapper.get("general/employee/").then((res) => { fetchWrapper.get("general/employee/").then((res) => {
if (res.type === "client_error") { if (res.type === "client_error") {
localStorage.clear(); localStorage.removeItem("tokenAccess");
this.$router.push("/login"); return this.$router.push("/login");
} else this.saveEmployeesData(res); } else this.saveEmployeesData(res);
}); });
}, },

View File

@@ -139,8 +139,8 @@ export default {
}` }`
); );
if (response.type === "client_error") { if (response.type === "client_error") {
localStorage.clear(); localStorage.removeItem("tokenAccess");
this.$router.push("/login"); return this.$router.push("/login");
} else { } else {
this.saveDataClients(response); this.saveDataClients(response);
this.saveClientsCount(response); this.saveClientsCount(response);