[WIP] Переход на страницу лоина, если токен просрочился
This commit is contained in:
@@ -105,9 +105,12 @@ export default {
|
|||||||
this.employeesData = res.results;
|
this.employeesData = res.results;
|
||||||
},
|
},
|
||||||
fetchEmployeesData() {
|
fetchEmployeesData() {
|
||||||
fetchWrapper
|
fetchWrapper.get("general/employee/").then((res) => {
|
||||||
.get("general/employee/")
|
if (res.type === "client_error") {
|
||||||
.then((res) => this.saveEmployeesData(res));
|
localStorage.clear();
|
||||||
|
this.$router.push("/login");
|
||||||
|
} else this.saveEmployeesData(res);
|
||||||
|
});
|
||||||
},
|
},
|
||||||
fetchEventsData() {
|
fetchEventsData() {
|
||||||
fetchWrapper
|
fetchWrapper
|
||||||
|
|||||||
@@ -138,12 +138,17 @@ export default {
|
|||||||
(this.currentTablePage - 1) * this.limit
|
(this.currentTablePage - 1) * this.limit
|
||||||
}`
|
}`
|
||||||
);
|
);
|
||||||
this.saveDataClients(response);
|
if (response.type === "client_error") {
|
||||||
this.saveClientsCount(response);
|
localStorage.clear();
|
||||||
this.paginationInfo = {
|
this.$router.push("/login");
|
||||||
currentPage: this.currentTablePage,
|
} else {
|
||||||
length: this.calculatePageCount(this.clientsCount),
|
this.saveDataClients(response);
|
||||||
};
|
this.saveClientsCount(response);
|
||||||
|
this.paginationInfo = {
|
||||||
|
currentPage: this.currentTablePage,
|
||||||
|
length: this.calculatePageCount(this.clientsCount),
|
||||||
|
};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
calculatePageCount(count) {
|
calculatePageCount(count) {
|
||||||
|
|||||||
Reference in New Issue
Block a user