This commit is contained in:
Lemuel Marquez
2021-01-06 16:33:56 -06:00
parent d6efd74b36
commit 9275fcdeb8
71 changed files with 130 additions and 150 deletions
+26 -28
View File
@@ -349,9 +349,8 @@ export default {
this.total = currentTotal;
})
.catch((error) => {
error(error.response.data.message);
this.error(error.response.data.message);
})
.finally(() => {
this.isLoading = false;
});
@@ -370,26 +369,26 @@ export default {
this.$router.push("/");
}
},
error(msj){
let salir =false;
switch(msj){
case 'invalid signature':
msj= "tu token no es valido, inicia sesión de nuevo"
salir=true
break;
case 'jwt expired':
msj= "tu sesión ha expirado, inicia sesión de nuevo"
salir=true
break;
case 'jwt malformed':
msj= "tu token esta mal formado, inicia sesión de nuevo"
salir=true
break;
case 'No hay token':
msj= "no has enviado tu token, inicia sesión de nuevo"
salir=true
break;
}
error(msj) {
let salir = false;
switch (msj) {
case "invalid signature":
msj = "Tu token no es valido, inicia sesión de nuevo.";
salir = true;
break;
case "jwt expired":
msj = "Tu sesión ha expirado, inicia sesión de nuevo.";
salir = true;
break;
case "jwt malformed":
msj = "tu token esta mal formado, inicia sesión de nuevo";
salir = true;
break;
case "No hay token":
msj = "Ocurrio un error al enviar tu token, inicia sesión de nuevo.";
salir = true;
break;
}
this.$buefy.dialog.alert({
title: "Error",
@@ -400,12 +399,11 @@ export default {
iconPack: "mdi",
ariaRole: "alertdialog",
ariaModal: true,
});
if (salir == true) {
localStorage.clear()
this.$router.push(`/`)
}
});
if (salir == true) {
localStorage.clear();
this.$router.push(`/`);
}
},
},
created() {