dev: hotfix, system by-passes role-access

This commit is contained in:
2025-10-24 15:34:31 +07:00
parent b90f0c1047
commit 3558672f9a
3 changed files with 8 additions and 6 deletions

No files matched your search

+4 -1
View File
@@ -7,7 +7,10 @@ export const useUserStore = defineStore(
const isAuthenticated = computed(() => !!user.value)
const userRole = computed(() => {
const roles = user.value?.roles || []
return roles.map((v) => v.split('-')[1])
return roles.map((input: string) => {
const parts = input.split('-')
return parts.length > 1 ? parts[1]: parts[0]
})
})
const login = async (userData: any) => {