创建 mine-type标头,和计算文件大小工具类
import mimeType from 'mime-types';
const sizes = ['B', 'KB', 'MB', 'GB', 'TB'];
export const bytesToSize = (bytes) => {
if (!bytes) {
return '0 B';
}
const sized = parseInt(Math.floor(Math.log(bytes) / Math.log(1024)));
return (bytes / Math.
原创
2021-07-20 13:56:59 ·
127 阅读 ·
0 评论