diff --git a/.gitignore b/.gitignore index b0d24e7..cf87c2d 100644 --- a/.gitignore +++ b/.gitignore @@ -32,4 +32,6 @@ deploy-test.sh deploy-prod.sh deploy-demo.sh -dist/ \ No newline at end of file +dist/ + +pnpm-lock.yaml \ No newline at end of file diff --git a/src/compenents/upload-courseware-button/index.tsx b/src/compenents/upload-courseware-button/index.tsx index 81b2ab4..e560581 100644 --- a/src/compenents/upload-courseware-button/index.tsx +++ b/src/compenents/upload-courseware-button/index.tsx @@ -12,7 +12,7 @@ import { } from "antd"; import Dragger from "antd/es/upload/Dragger"; import { useEffect, useRef, useState } from "react"; -import { generateUUID, parseVideo } from "../../utils"; +import { generateUUID } from "../../utils"; import { minioMergeVideo, minioUploadId } from "../../api/upload"; import { UploadChunk } from "../../js/minio-upload-chunk"; @@ -58,6 +58,10 @@ export const UploadCoursewareButton = (props: PropsInterface) => { const uploadProps = { multiple: true, beforeUpload: async (file: File) => { + if (file.size === 0) { + message.error(`文件 ${file.name} 为空文件`); + return Upload.LIST_IGNORE; + } let extension: any = file.name.split("."); extension = extension[extension.length - 1]; if (