From aebad61b3d3e11aaf720b37e762e53e2e6999d3c Mon Sep 17 00:00:00 2001 From: vben Date: Sun, 30 May 2021 22:30:26 +0800 Subject: [PATCH] fix: ensure that roleList is not empty --- src/store/modules/permission.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/store/modules/permission.ts b/src/store/modules/permission.ts index c75fce5d..14c7a463 100644 --- a/src/store/modules/permission.ts +++ b/src/store/modules/permission.ts @@ -91,7 +91,7 @@ export const usePermissionStore = defineStore({ const appStore = useAppStoreWidthOut(); let routes: AppRouteRecordRaw[] = []; - const roleList = toRaw(userStore.getRoleList); + const roleList = toRaw(userStore.getRoleList) || []; const { permissionMode = projectSetting.permissionMode } = appStore.getProjectConfig; // role permissions if (permissionMode === PermissionModeEnum.ROLE) { -- GitLab