|
|
@@ -67,6 +67,7 @@ const KnowledgeLibInfo: React.FC = () => {
|
|
|
const fileExt = file.name.split('.').pop()?.toLowerCase();
|
|
|
if (!fileExt || !allowedExtensions.includes(fileExt)) {
|
|
|
message.error(`不支持 ${fileExt} 格式的文件上传`);
|
|
|
+ setUploadLoading(false);
|
|
|
return Upload.LIST_IGNORE;
|
|
|
}
|
|
|
}
|
|
|
@@ -79,11 +80,13 @@ const KnowledgeLibInfo: React.FC = () => {
|
|
|
|
|
|
if (fileSizeMB > 30) {
|
|
|
message.error('单个文件不能大于30M');
|
|
|
+ setUploadLoading(false);
|
|
|
return Upload.LIST_IGNORE;
|
|
|
}
|
|
|
|
|
|
if (['jpg', 'png', 'jpeg'].includes(fileExt!) && fileSizeMB > 5) {
|
|
|
message.error('单张图片不能大于5M');
|
|
|
+ setUploadLoading(false);
|
|
|
return Upload.LIST_IGNORE;
|
|
|
}
|
|
|
|
|
|
@@ -92,6 +95,7 @@ const KnowledgeLibInfo: React.FC = () => {
|
|
|
|
|
|
if (totalSize > 125) {
|
|
|
message.error('文件总大小超过125M');
|
|
|
+ setUploadLoading(false);
|
|
|
return Upload.LIST_IGNORE;
|
|
|
}
|
|
|
|