diff --git a/src/components/UploadFile/src/UploadFile.vue b/src/components/UploadFile/src/UploadFile.vue index d6fe4e53f..bb3677817 100644 --- a/src/components/UploadFile/src/UploadFile.vue +++ b/src/components/UploadFile/src/UploadFile.vue @@ -109,17 +109,21 @@ const beforeUpload: UploadProps['beforeUpload'] = (file: UploadRawFile) => { // } // 文件上传成功 const handleFileSuccess: UploadProps['onSuccess'] = (res: any,uploadFile: any): void => { - message.success(t('ts.上传成功')) - const fileListNew = fileList.value - fileListNew.pop() - fileList.value = fileListNew - uploadList.value.push({ name: uploadFile.name, url: res.data }) - // if (uploadList.value.length == uploadNumber.value) { - if(fileList.value.every(it => it.status == 'success')) { - fileList.value = fileList.value.concat(uploadList.value) - uploadList.value = [] - uploadNumber.value = 0 - emit('update:modelValue', listToString(fileList.value),res,uploadFile) + if(res&&res.code==0){ + message.success(t('ts.上传成功')) + const fileListNew = fileList.value + fileListNew.pop() + fileList.value = fileListNew + uploadList.value.push({ name: uploadFile.name, url: res.data }) + // if (uploadList.value.length == uploadNumber.value) { + if(fileList.value.every(it => it.status == 'success')) { + fileList.value = fileList.value.concat(uploadList.value) + uploadList.value = [] + uploadNumber.value = 0 + emit('update:modelValue', listToString(fileList.value),res,uploadFile) + } + }else{ + message.error(res.msg) } } // 文件数超出提示