feat: 兼容前端按钮权限数据

This commit is contained in:
zxr
2026-07-21 23:51:18 +08:00
parent b4dba77229
commit 4b9a87638c
5 changed files with 109 additions and 41 deletions

View File

@@ -0,0 +1,14 @@
import { computed } from 'vue'
import { useAppStore } from '@/store'
export default function usePermissionCodes() {
const appStore = useAppStore()
const permissionCodes = computed(() => appStore.permissionCodes as string[])
const hasPermission = (code: string) => permissionCodes.value.includes(code)
return {
permissionCodes,
hasPermission,
}
}