token expire, remove console

This commit is contained in:
2021-08-24 20:08:42 -05:00
parent 3b2a06b043
commit a55f45cafd
10 changed files with 279 additions and 179 deletions

View File

@@ -1,7 +1,7 @@
export const state = () => ({
auth: null,
notifications: [],
filtro: {fechas:fechaString().slice(0, 7),npresupuesto:5},
filtro: { fechas: fechaString().slice(0, 7), npresupuesto: 5 },
fecha: fechaString(),
categorias: [],
metodos_de_pago: []
@@ -23,10 +23,8 @@ export const mutations = {
setMetodos(state, metodos) {
state.metodos_de_pago = metodos;
},
actualizarFiltro(state,filtro) {
state.filtro=filtro
actualizarFiltro(state, filtro) {
state.filtro = filtro;
}
};
@@ -64,7 +62,9 @@ export const actions = {
this.commit("setCategorias", res.data.data);
})
.catch(error => {
console.log(error);
localStorage.clear();
const auth = {};
this.commit("setAuth", auth);
});
},
@@ -74,12 +74,17 @@ export const actions = {
token: this.state.auth.token
}
};
await this.$axios
await this.$axios
.get("/metodo", axiosHeader)
.then(res => {
this.commit("setMetodos", res.data.data);
})
.catch(e => console.log(e));
},
.catch(e => {
//Redireccion token
localStorage.clear();
const auth = {};
this.commit("setAuth", auth);
window.location.href = "/login";
});
}
};