From a770137d65fdd5bedc89ae1bc16c8d76f3374bf4 Mon Sep 17 00:00:00 2001 From: chenxi-20 <2465950588@qq.com> Date: Fri, 24 Mar 2023 17:47:30 +0800 Subject: [PATCH] =?UTF-8?q?fix(upload):=20=E5=8F=96=E6=B6=88fileupload?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E7=9A=84=E8=87=AA=E5=8A=A8=E9=9A=90=E8=97=8F?= =?UTF-8?q?=E5=92=8C=E6=8F=90=E7=A4=BA=E5=8A=9F=E8=83=BD=EF=BC=8C=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E6=88=90=E7=94=A8=E6=88=B7=E5=8F=AF=E8=87=AA=E5=AE=9A?= =?UTF-8?q?=E4=B9=89=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/upload/index.js | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/src/upload/index.js b/src/upload/index.js index 66c51df..1e21678 100644 --- a/src/upload/index.js +++ b/src/upload/index.js @@ -56,17 +56,9 @@ export const getFormData = ({ constants, state, parent, props }) => ({ formData, export const uploadFiles = ({ state, constants, Modal, props, t }) => (files) => { const { limit, fileList } = props - if (limit) { - const fileCount = fileList.length + files.length - if (fileCount > limit) { - props.onExceed && props.onExceed(files, fileList) - return - } else if (fileCount === limit) { - Modal.message({ - message: `${t('ui.upload.limitUploadFileNumber')}:${limit}`, - status: 'info' - }) - } + if (limit && fileList.length + files.length > limit) { + props.onExceed && props.onExceed(files, fileList) + return } let postFiles = Array.prototype.slice.call(files)