#29 refactor: replace admin code with role-based auth using Pinia

This commit is contained in:
mono
2026-03-14 22:55:24 -05:00
parent 2c9ea4b871
commit 786d0551bb
12 changed files with 105 additions and 129 deletions

View File

@@ -1,8 +1,5 @@
<template>
<div>
<CodeDialog @code-verified="(verified) => showComponent = verified"/>
</div>
<v-container class="fill-height d-flex align-center justify-center">
<v-container v-if="authStore.isAdmin" class="fill-height d-flex align-center justify-center">
<v-card class="pa-6" max-width="600" elevation="4">
<v-card-title class="text-h5 font-weight-bold text-center">
🔄 Sincronización de Ventas
@@ -35,16 +32,24 @@
</v-container>
</template>
<script>
import CodeDialog from '../components/CodeDialog.vue';
import { useAuthStore } from '@/stores/auth';
import { inject } from 'vue';
export default {
name: 'SalesToTryton',
setup() {
const authStore = useAuthStore();
return { authStore };
},
data() {
return {
api: inject('api'),
ventas_tryton: [],
showComponent: false,
}
},
mounted() {
if (!this.authStore.isAdmin) {
this.$router.push('/');
}
},
methods: {