This commit is contained in:
禺狨 2023-04-04 09:45:50 +08:00
commit 745004e2ca
5 changed files with 20 additions and 10 deletions

View File

@ -81,7 +81,7 @@ export const UploadVideoButton = (props: PropsInterface) => {
minioMergeVideo(
item.filename,
item.uploadId,
props.categoryIds.join(','),
props.categoryIds.join(","),
item.name,
"mp4",
item.size,
@ -119,6 +119,12 @@ export const UploadVideoButton = (props: PropsInterface) => {
},
};
const closeWin = () => {
setShowModal(false);
setFileList([]);
props.onUpdate();
};
return (
<>
<Button
@ -136,14 +142,12 @@ export const UploadVideoButton = (props: PropsInterface) => {
title="上传视频"
open={true}
onCancel={() => {
setShowModal(false);
props.onUpdate();
closeWin();
}}
maskClosable={false}
closable={false}
onOk={() => {
setShowModal(false);
props.onUpdate();
closeWin();
}}
>
<Row gutter={[0, 10]}>

View File

@ -65,6 +65,9 @@ if (getToken()) {
});
});
} else {
if (window.location.pathname !== "/login") {
window.location.href = "/login";
}
RootPage = <InitPage loginData={null} />;
}

8
src/types/index.d.ts vendored Normal file
View File

@ -0,0 +1,8 @@
declare global {
interface VideoParseInfo {
poster: string;
duration: number;
}
}
export {}

View File

@ -1,4 +0,0 @@
export interface VideoParseInfo {
poster:string;
duration:number;
}

View File

@ -1,5 +1,4 @@
import moment from "moment";
import { VideoParseInfo } from "../types";
export function getToken(): string {
return window.localStorage.getItem("playedu-backend-token") || "";