From cd6d444a3fc74be13700b4847e2d9bf78000e5f7 Mon Sep 17 00:00:00 2001 From: chenos Date: Fri, 8 Jan 2021 09:23:51 +0800 Subject: [PATCH] fix: filter failed files --- packages/app/src/components/form.fields/upload/index.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/app/src/components/form.fields/upload/index.tsx b/packages/app/src/components/form.fields/upload/index.tsx index 5f7042933e..e0e16bccb0 100644 --- a/packages/app/src/components/form.fields/upload/index.tsx +++ b/packages/app/src/components/form.fields/upload/index.tsx @@ -171,7 +171,7 @@ function toValues(fileList) { if (!Array.isArray(fileList) && typeof fileList === 'object') { fileList = [fileList]; } - return fileList.map(toValue); + return fileList.map(toValue).filter(item => item.id); } export function getImgUrls(value) { @@ -213,7 +213,8 @@ export const Upload = connect({ setImgIndex(index); setVisible(true); } else { - window.location.href = value.url; + window.open(value.url) + // window.location.href = value.url; } }} // itemRender={(originNode, file, fileList) => {