优化upload

master
LiuJiaNan 2025-11-07 09:04:06 +08:00
parent 3b06408ff3
commit e90d71cd52
2 changed files with 3 additions and 5 deletions

View File

@ -19,6 +19,8 @@ export interface UploadProps extends Omit<AntUploadProps, "fileList"> {
uploadButtonText?: string;
/** 要上传的文件类型,默认为 image */
fileType?: "image" | "video" | "document";
/** 获取上传过服务器删除的附件 */
onGetRemoveFile?: (file: UploadFile) => void;
}
/**
@ -28,7 +30,3 @@ export interface UploadProps extends Omit<AntUploadProps, "fileList"> {
declare const Upload: FC<UploadProps>;
export default Upload;
// 视频数量默认1个且只支持mp4格式单个文件大小默认100M
// 文件数量默认4个且只支持pdf、doc、docx格式
// 图片数量默认4个且只支持jpg、jpeg、png格式

View File

@ -193,7 +193,7 @@ const Upload = (props) => {
// 删除文件
const handleRemove = (file) => {
if (file.originFileObj)
if (!file.originFileObj)
onGetRemoveFile?.(file);
return onRemove?.(file);
}