Commit e4979bed authored by Adrian's avatar Adrian

verificando existencia del token

parent 6a71d141
......@@ -21,7 +21,7 @@ VUE_APP_PUBLIC_PATH=/ Para indicar si se tiene un
VUE_APP_AUTH_TOKEN=Bearer Formato para enviar el token
```
## Para los iconos se esta utilizando [material icons](https://materialdesignicons.com/)
### Para los iconos se esta utilizando [material icons](https://materialdesignicons.com/)
## Instalando el proyecto
......
......@@ -84,15 +84,17 @@ export default {
store.commit('setDefault');
},
async logout(router, store) {
const request = {
url: `${this.$baseServer}logout`,
method: 'GET',
headers: {
Authorization: `Bearer ${this.$storage.get('token')}`
}
};
const response = await axios(request);
console.log(response);
if (this.$storage.get('token')) {
const request = {
url: `${this.$baseServer}logout`,
method: 'GET',
headers: {
Authorization: `Bearer ${this.$storage.get('token')}`
}
};
const response = await axios(request);
console.log(response);
}
const storevuex = store || this.$store;
router = router || this.$router;
this.$storage.removeUser();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment