import lrz from "lrz";
let imgAry = URL.createObjectURL(file, { quality: 0 }); // 默认0.7 图片压缩质量 0-1
let lrzFile = await lrz(imgAry);
let f = new window.File([lrzFile.file], file.name, {
type: lrzFile.file.type,
});
const formData = new FormData();
formData.append("file", f);
let res = await this.$axios.uploadImage(formData);
网友评论