init auth

This commit is contained in:
xds
2026-02-08 17:36:22 +03:00
parent 7732856f90
commit 6856449075
11 changed files with 473 additions and 68 deletions

View File

@@ -1,13 +1,15 @@
<script setup>
import { computed } from 'vue'
import { useRouter, useRoute } from 'vue-router'
import { useAuthStore } from '@/stores/auth'
import Button from 'primevue/button'
const router = useRouter()
const route = useRoute()
const authStore = useAuthStore()
const handleLogout = () => {
localStorage.removeItem('auth_code')
authStore.logout()
router.push('/login')
}
@@ -18,14 +20,22 @@ const isActive = (path) => {
return route.path.startsWith(path)
}
const navItems = [
{ path: '/', icon: '🏠', tooltip: 'Home' },
{ path: '/assets', icon: '📂', tooltip: 'Assets' },
{ path: '/generation', icon: '🎨', tooltip: 'Image Generation' },
{ path: '/flexible-generation', icon: '🖌️', tooltip: 'Flexible Generation' },
{ path: '/characters', icon: '👥', tooltip: 'Characters' },
{ path: '/image-to-prompt', icon: '', tooltip: 'Image to Prompt' }
]
const navItems = computed(() => {
const items = [
{ path: '/', icon: '🏠', tooltip: 'Home' },
{ path: '/assets', icon: '📂', tooltip: 'Assets' },
// { path: '/generation', icon: '🎨', tooltip: 'Image Generation' },
{ path: '/flexible', icon: '🖌️', tooltip: 'Flexible Generation' },
{ path: '/characters', icon: '👥', tooltip: 'Characters' },
{ path: '/image-to-prompt', icon: '✨', tooltip: 'Image to Prompt' }
]
if (authStore.isAdmin()) {
items.push({ path: '/admin/approvals', icon: '🛡️', tooltip: 'Approvals' })
}
return items
})
</script>
<template>