fix: 修复素材库批量删除后白屏崩溃 #509
Reference in New Issue
Block a user
Delete Branch "fix/asset-batch-delete-crash"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
问题
批量删除素材后页面白屏,报错:
Cannot read properties of undefined (reading 'length')根因
batchDeleteAssets直接返回response.data,当后端返回字段缺失或格式不一致时,Drawer 中operationResult.succeeded.length会因succeeded为 undefined 而崩溃,导致整个页面白屏。修复
normalizeBatchResult()工具函数,统一归一化 4 个批量操作(删除/打标签/改分类/智能标记)返回值,succeeded/failed缺失时默认空数组,success_count/failure_count/total缺失时根据数组长度推导apiAssets/apiLibraries增加Array.isArray防御性检查,非数组时兜底为空数组验证场景
🗑️ 预览环境已清理
PR #509 已关闭或合并,对应的预览环境已被清理。