提交 c7aed2b6 authored 作者: 钟是志's avatar 钟是志

修改视频上传组件

上级 789cb895
......@@ -59,10 +59,21 @@ export default class VideoUploadCom extends React.Component {
changeUrl = (info, key) => {
if (info.file.status === 'done') {
let filePathThis = info?.file?.response?.data?.filePath;
message.info('视频正在转换中,请稍后');
message.info('正在获取视频缩略图,请稍后');
if (filePathThis) {
setTimeout(() => {
umiRequest(`${configService}/folderApi/findByPath?token=${token}&path=${filePathThis}`, {method: 'GET'}).then((res) => {
umiRequest(`${configService}/folderConvertApi/videoScreenshot?token=${token}`, {
method: "POST", // 暂时支持post 请求
headers: {
Accept: "application/json;charset=UTF-8",
// 'Content-Type': 'application/json',
},
requestType: 'form',
data: {
path: filePathThis,
screenshotTime: '00:00:5',
},
}).then((res) => {
if (res && res.data) {
let info = res.data;
const {screenshots, url, createTime, downloadUrl, filePath} = info;
......@@ -72,12 +83,13 @@ export default class VideoUploadCom extends React.Component {
createTime,
downloadUrl,
filePath,
fileExt,
};
message.success(`视频上传成功`);
this.triggerChange(JSON.stringify(needInfo));
}
});
}, 5000);
}, 3000);
}
} else if (info.file.status === 'error') {
message.error(`视频上传失败`);
......
......@@ -55,7 +55,7 @@ import MobileDate from '../libs/MobileDate';
import ChildForm from '../libs/ChildForm';
import Neo4jD3Com from '../libs/Neo4jD3Com';
import ImgUploadCom from '../libs/ImgUploadCom';
import VideoUploadCom from "../libs/VideoUploadCom";
import VideoUploadCom from '../libs/VideoUploadCom';
import moment from 'moment';
import router from 'umi/router';
import TableList from '../libs/TableList';
......@@ -67,7 +67,7 @@ import { extend } from 'umi-request';
import Highlighter from 'react-highlight-words';
import Signature from '../Signature';
import { changeToDraftState } from '../utils/myutils';
import baseX from 'base-x';
import { Base16Encode } from '../Base16/index';
import { getToken } from '../utils/token';
import { formulaList } from '../excelInitFuc/functionList';
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论