上传组件验证文件格式错误问题修复
This commit is contained in:
@ -50,7 +50,7 @@ const FileUpload: React.FC<FileUploadProps> = ({
|
||||
listType = 'text',
|
||||
buttonText,
|
||||
disabled = false,
|
||||
accept,
|
||||
accept = allowedTypes.map(type => `.${type}`).join(','),
|
||||
showUploadList = true,
|
||||
isDragger = false,
|
||||
tip,
|
||||
@ -163,7 +163,7 @@ const FileUpload: React.FC<FileUploadProps> = ({
|
||||
};
|
||||
|
||||
const beforeUpload = (file: File) => {
|
||||
return validateFileSize(file, maxSize, allowedTypes);
|
||||
return validateFileSize(file, maxSize);
|
||||
};
|
||||
|
||||
const UploadComponent = isDragger ? Upload.Dragger : Upload;
|
||||
|
Reference in New Issue
Block a user