if (file.size > 5 * 1024 * 1024 * 10) {
//大于50M分片
this.progressShow = true;
this.progressstripShow = true;
//获取切片数量
let num = Math.ceil(file.size / (5 * 1024 * 1024));
let axiosArray = [];
//每一片为5mb
let chunkSize = 5 * 1024 * 1024;
let current = 0;
const getLabel = () => {
return new Promise((resolve) => {
let chunkList = [];
while (current < num) {
chunkList.push({
chunk: file.slice(
current * chunkSize,
(current + 1) * chunkSize
),
fileName: current + "_" + file.name,
});
current++;
}
resolve(chunkList);