Commit 25647536 by zhangleyuan

feat:处理上传视频大小的限制

parent 86391c6e
......@@ -4,9 +4,9 @@
* @Last Modified by: 吴文洁
* @Last Modified time: 2020-07-16 11:32:50
*/
const DEFAULT_SIZE_UNIT = 1024 * 1024; // 将B转换成M
const DEFAULT_SIZE_UNIT = 1000 * 1000; // 将B转换成M
const GIGABYTE_SIZE_UNIT = 1024 * 1024 * 1024; // 转换为G
const GIGABYTE_SIZE_UNIT = 1000 * 1000 * 1000; // 转换为G
const SupportFileType = [
"application/msword",
......@@ -106,11 +106,11 @@ const FileVerifyMap = {
},
"audio/mp4": {
type: "MP4",
maxSize: 2048
maxSize: 2000
},
"video/mp4": {
type: "MP4",
maxSize: 2048
maxSize: 2000
}
};
......
......@@ -2,11 +2,11 @@
* @Author: 吴文洁
* @Date: 2020-07-23 17:11:49
* @LastEditors: zhangleyuan
* @LastEditTime: 2020-12-18 17:54:36
* @LastEditTime: 2021-03-04 17:16:01
* @Description:
* @Copyright: 杭州杰竞科技有限公司 版权所有
*/
const DEFAULT_SIZE_UNIT = 1024 * 1024; // 将B转换成M
const DEFAULT_SIZE_UNIT = 1000 * 1000; // 将B转换成M
const SupportFileType = [
"application/msword",
......
......@@ -2,11 +2,11 @@
* @Author: 吴文洁
* @Date: 2020-08-20 09:21:40
* @LastEditors: zhangleyuan
* @LastEditTime: 2021-03-04 10:22:07
* @LastEditTime: 2021-03-04 17:16:30
* @Description:
* @Copyright: 杭州杰竞科技有限公司 版权所有
*/
const DEFAULT_SIZE_UNIT: number = 1024 * 1024; // 将B转换成M
const DEFAULT_SIZE_UNIT: number = 1000 * 1000; // 将B转换成M
const SUFFIX_MAP: {
[key: string]: string
......@@ -139,11 +139,11 @@ const FILR_VERIFY_MAP = {
},
"audio/mp4": {
type: "MP4",
maxSize: 2048
maxSize: 2000
},
"video/mp4": {
type: "MP4",
maxSize: 2048
maxSize: 2000
}
};
......
......@@ -448,7 +448,7 @@ class FolderList extends React.Component {
nonCompliantFileList.push(file);
_fileList.splice(index, 1);
}
if (type.indexOf('video') > -1 && size > 2048 * DEFAULT_SIZE_UNIT) {
if (type.indexOf('video') > -1 && size > 2000 * DEFAULT_SIZE_UNIT) {
nonCompliantFileList.push(file);
_fileList.splice(index, 1);
}
......
......@@ -135,7 +135,7 @@ class OperateArea extends React.Component {
nonCompliantFileList.push(file);
_fileList.splice(index, 1);
}
if (type.indexOf('video') > -1 && size > 2048 * DEFAULT_SIZE_UNIT) {
if (type.indexOf('video') > -1 && size > 2000 * DEFAULT_SIZE_UNIT) {
nonCompliantFileList.push(file);
_fileList.splice(index, 1);
}
......
......@@ -484,7 +484,7 @@ class FolderList extends React.Component {
nonCompliantFileList.push(file);
_fileList.splice(index, 1);
}
if (type.indexOf('video') > -1 && size > 2048 * DEFAULT_SIZE_UNIT) {
if (type.indexOf('video') > -1 && size > 2000 * DEFAULT_SIZE_UNIT) {
nonCompliantFileList.push(file);
_fileList.splice(index, 1);
}
......
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