fix: 单文件查询到会走多文件的判断
This commit is contained in:
parent
bc9e3a50e1
commit
c0a5942c2a
@ -337,7 +337,12 @@ export function useUpload(
|
|||||||
return;
|
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) =>
|
bindValue.value = (bindValue.value as string[]).filter((ossId) =>
|
||||||
resp.map((res) => res.ossId).includes(ossId),
|
resp.map((res) => res.ossId).includes(ossId),
|
||||||
);
|
);
|
||||||
|
@ -16,7 +16,7 @@ import { useFileType, useImageType } from './hook';
|
|||||||
import sql from './insert.sql?raw';
|
import sql from './insert.sql?raw';
|
||||||
|
|
||||||
const singleImageId = ref('1905537674682916865');
|
const singleImageId = ref('1905537674682916865');
|
||||||
const singleFileId = ref('1906520520833949698');
|
const singleFileId = ref('1905191167882518529');
|
||||||
const multipleImageId = ref<string[]>(['1905537674682916865']);
|
const multipleImageId = ref<string[]>(['1905537674682916865']);
|
||||||
const multipleFileId = ref<string[]>(['1905191167882518529']);
|
const multipleFileId = ref<string[]>(['1905191167882518529']);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user