From fd74d3b8244bdc75411f5e27bc24aed009a1f1ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=8A=A0=E8=84=9A=E6=9C=AC=E4=BA=BA?= <742374184@qq.com> Date: Sun, 22 Dec 2024 17:16:19 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8DAccessControl=E9=BB=98?= =?UTF-8?q?=E8=AE=A4codes=E9=80=BB=E8=BE=91=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/effects/access/src/access-control.vue | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/effects/access/src/access-control.vue b/packages/effects/access/src/access-control.vue index 219608e557b..e5645dc4578 100644 --- a/packages/effects/access/src/access-control.vue +++ b/packages/effects/access/src/access-control.vue @@ -13,7 +13,6 @@ import { useAccess } from './use-access'; interface Props { /** * Specified codes is visible - * @default [] */ codes?: string[]; @@ -29,14 +28,14 @@ defineOptions({ }); const props = withDefaults(defineProps(), { - codes: () => [], + codes: undefined, type: 'role', }); const { hasAccessByCodes, hasAccessByRoles } = useAccess(); const hasAuth = computed(() => { - const { codes, type } = props; + const { codes = [], type } = props; return type === 'role' ? hasAccessByRoles(codes) : hasAccessByCodes(codes); });