close sesion question added

This commit is contained in:
Alexandro Uc Santos
2024-03-04 21:29:12 -06:00
parent 6a54ed3dbe
commit 948ba588eb
4 changed files with 28 additions and 12 deletions

View File

@@ -1,20 +1,26 @@
<script setup>
import { RouterLink, useRoute, useRouter } from 'vue-router';
import { useAuthStore } from '../stores/auth';
import Swal from 'sweetalert2';
const route = useRoute();
const router = useRouter();
const auth = useAuthStore();
const handleLogout = () => {
// auth.$patch({
// sesion: '',
// token: '',
// user: {},
// });
// localStorage.removeItem('session');
// router.push({name: 'login'});
auth.logout();
Swal.fire({
title: 'Cerrar sesión',
text: '¿Estás seguro de cerrar sesión?',
icon: 'question',
showCancelButton: true,
cancelButtonColor: "#d33",
confirmButtonText: 'Si',
cancelButtonText: 'No',
}).then(async(result) => {
if(result.isConfirmed) {
auth.logout();
}
});
}
</script>

View File

@@ -12,9 +12,6 @@
const companyStore = useCompanyStore()
const notifications = useNotificationsStore()
console.log(companyStore.company?.categories);
const loading = ref(false);
const msgError = ref('');
const companyCategories = ref([]);