Commit 3ff1a860 authored by zhuyangbin's avatar zhuyangbin

视频组件

parent 638cdc29
......@@ -11,7 +11,9 @@ message.config({
});
const UploadCom = (props) => {
const { onChange, CDN_HOST, getFormat, setFormat, data, maxLength, disabled } = props;
const {
onChange, CDN_HOST, getFormat, setFormat, data, maxLength, disabled,
} = props;
const selfProps = antiAssign(props, ['onChange', 'CDN_HOST', 'data']);
const getFormatFileList = (fileList = []) => {
if (!fileList) {
......@@ -106,7 +108,7 @@ const UploadCom = (props) => {
const previewFile = (file) => {
return new Promise((res, rej) => {
const obj = checkoutFileType(file.name);
const typeArr = file.name.match(/\.[a-zA-Z]+$/);
const typeArr = file.name.match(/\.[a-zA-Z0-9]+$/);
const type = typeArr && typeArr[0] ? typeArr[0].replace('.', '') : '';
if (!['png', 'gif', 'bmp', 'jpg', 'jpeg'].includes(type)) {
res(obj.thumbUrl);
......@@ -125,6 +127,8 @@ const UploadCom = (props) => {
onSaveFileList(newFileList);
};
const onDownload = (file) => {};
const beforeUpload = async () => {
await getToken();
return true;
......@@ -144,6 +148,7 @@ const UploadCom = (props) => {
onRemove={onRemove}
previewFile={previewFile}
onPreview={onPreview}
onDownload={onDownload}
showUploadList={{
showPreviewIcon: true,
showRemoveIcon: true,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment