[WIP] Фикс удаления токена
This commit is contained in:
@@ -55,7 +55,7 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
logout() {
|
logout() {
|
||||||
localStorage.clear();
|
localStorage.removeItem("tokenAccess");
|
||||||
this.$router.push("/login");
|
this.$router.push("/login");
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -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);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -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);
|
||||||
|
|||||||
Reference in New Issue
Block a user