generated from VLADIMIR/template_frontend
fix
This commit is contained in:
@@ -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 = []
|
||||||
const res = await client.GetPermissions({})
|
try {
|
||||||
permissions.value = res.permissions!
|
const res = await client.GetPermissions({})
|
||||||
|
permissions.value = res.permissions || []
|
||||||
|
} catch (err) {
|
||||||
|
message.error('Не удалось загрузить права доступа')
|
||||||
|
console.error('Failed to load permissions:', err)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
getPermissions()
|
getPermissions()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user