fix: 单文件查询到会走多文件的判断

This commit is contained in:
dap
2025-03-31 10:47:30 +08:00
parent bc9e3a50e1
commit c0a5942c2a
2 changed files with 7 additions and 2 deletions

View File

@@ -337,7 +337,12 @@ export function useUpload(
return;
}
// 多文件
if (resp.length !== value.length && !props.keepMissingId) {
// 单文件查到了也会走这里的逻辑 filter会报错 需要maxCount判断处理
if (
resp.length !== value.length &&
!props.keepMissingId &&
props.maxCount !== 1
) {
bindValue.value = (bindValue.value as string[]).filter((ossId) =>
resp.map((res) => res.ossId).includes(ossId),
);