generated from VLADIMIR/template_frontend
fix
This commit is contained in:
@@ -1,25 +1,31 @@
|
||||
<script setup lang="ts">
|
||||
const props = defineProps<{ active?: string }>()
|
||||
|
||||
import { MenuOutlined } from '@vicons/material'
|
||||
import { Icon } from '@vicons/utils'
|
||||
import { useMessage } from 'naive-ui'
|
||||
import { ref } from 'vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
|
||||
import { getAuthClient } from '@/api/auth_client'
|
||||
import { useAuthStore } from '@/stores/auth'
|
||||
|
||||
const props = defineProps<{ active?: string }>()
|
||||
const authStore = useAuthStore()
|
||||
|
||||
const router = useRouter()
|
||||
const client = getAuthClient()
|
||||
const message = useMessage()
|
||||
|
||||
const permissions = ref<string[]>([])
|
||||
|
||||
async function getPermissions() {
|
||||
permissions.value = []
|
||||
const res = await client.GetPermissions({})
|
||||
permissions.value = res.permissions!
|
||||
try {
|
||||
const res = await client.GetPermissions({})
|
||||
permissions.value = res.permissions || []
|
||||
} catch (err) {
|
||||
message.error('Не удалось загрузить права доступа')
|
||||
console.error('Failed to load permissions:', err)
|
||||
}
|
||||
}
|
||||
getPermissions()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user