This commit is contained in:
2026-10-03 14:17:12 +07:00
parent 0d7069cc43
commit 04ad594231
+9 -3
View File
@@ -1,25 +1,31 @@
<script setup lang="ts"> <script setup lang="ts">
const props = defineProps<{ active?: string }>()
import { MenuOutlined } from '@vicons/material' import { MenuOutlined } from '@vicons/material'
import { Icon } from '@vicons/utils' import { Icon } from '@vicons/utils'
import { useMessage } from 'naive-ui'
import { ref } from 'vue' import { ref } from 'vue'
import { useRouter } from 'vue-router' import { useRouter } from 'vue-router'
import { getAuthClient } from '@/api/auth_client' import { getAuthClient } from '@/api/auth_client'
import { useAuthStore } from '@/stores/auth' import { useAuthStore } from '@/stores/auth'
const props = defineProps<{ active?: string }>()
const authStore = useAuthStore() const authStore = useAuthStore()
const router = useRouter() const router = useRouter()
const client = getAuthClient() const client = getAuthClient()
const message = useMessage()
const permissions = ref<string[]>([]) const permissions = ref<string[]>([])
async function getPermissions() { async function getPermissions() {
permissions.value = [] permissions.value = []
try {
const res = await client.GetPermissions({}) const res = await client.GetPermissions({})
permissions.value = res.permissions! permissions.value = res.permissions || []
} catch (err) {
message.error('Не удалось загрузить права доступа')
console.error('Failed to load permissions:', err)
}
} }
getPermissions() getPermissions()