mirror of
https://github.com/PlayEdu/backend
synced 2025-06-09 00:44:08 +08:00
上传视频关闭窗口取消所有任务
This commit is contained in:
parent
b4dd5a6b46
commit
defc71697a
@ -124,14 +124,29 @@ export const UploadVideoButton = (props: PropsInterface) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const closeWin = () => {
|
const closeWin = () => {
|
||||||
if (upRef.current > 0) {
|
// if (upRef.current > 0) {
|
||||||
message.error(`等待上传成功后才能关闭`);
|
// message.error(`等待上传成功后才能关闭`);
|
||||||
return;
|
// return;
|
||||||
}
|
// }
|
||||||
|
|
||||||
|
if (fileList.length > 0) {
|
||||||
|
let i = 0;
|
||||||
|
fileList.map((item: any) => {
|
||||||
|
item.run.cancel();
|
||||||
|
i++;
|
||||||
|
});
|
||||||
|
if (i === fileList.length) {
|
||||||
setShowModal(false);
|
setShowModal(false);
|
||||||
setFileList([]);
|
setFileList([]);
|
||||||
localFileList.current = [];
|
localFileList.current = [];
|
||||||
props.onUpdate();
|
props.onUpdate();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
setShowModal(false);
|
||||||
|
setFileList([]);
|
||||||
|
localFileList.current = [];
|
||||||
|
props.onUpdate();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
Loading…
x
Reference in New Issue
Block a user