mirror of https://github.com/fantasticit/think.git
client: fix upload progress
This commit is contained in:
parent
ba60716390
commit
610367b8ae
|
@ -115,9 +115,13 @@ export const uploadFile = async (
|
||||||
onUploadProgress: (progress) => {
|
onUploadProgress: (progress) => {
|
||||||
progressMap[currentIndex] = progress * unitPercent;
|
progressMap[currentIndex] = progress * unitPercent;
|
||||||
wraponUploadProgress(
|
wraponUploadProgress(
|
||||||
Object.keys(progressMap).reduce((a, c) => {
|
Math.min(
|
||||||
return (a += progressMap[c]);
|
Object.keys(progressMap).reduce((a, c) => {
|
||||||
}, 0)
|
return (a += progressMap[c]);
|
||||||
|
}, 0),
|
||||||
|
// 剩下的 5% 交给 merge
|
||||||
|
0.95
|
||||||
|
)
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
@ -131,10 +135,10 @@ export const uploadFile = async (
|
||||||
md5,
|
md5,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
} else {
|
|
||||||
wraponUploadProgress(1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
wraponUploadProgress(1);
|
||||||
|
|
||||||
return url;
|
return url;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue