mirror of
https://github.com/PlayEdu/backend
synced 2025-06-05 01:34:10 +08:00
空文件的判断
This commit is contained in:
parent
d9f3f27d11
commit
5d0af0f51a
4
.gitignore
vendored
4
.gitignore
vendored
@ -32,4 +32,6 @@ deploy-test.sh
|
||||
deploy-prod.sh
|
||||
deploy-demo.sh
|
||||
|
||||
dist/
|
||||
dist/
|
||||
|
||||
pnpm-lock.yaml
|
@ -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 (
|
||||
|
Loading…
x
Reference in New Issue
Block a user