Explorar el Código

fix: ensure that roleList is not empty

vben hace 3 años
padre
commit
aebad61b3d
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1 1
      src/store/modules/permission.ts

+ 1 - 1
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) {