// base64转成bolb对象
dataURItoBlob(base64Data) {
let byteString;
if (base64Data.split(“,”)[0].indexOf(“base64”) >= 0) {
byteString = atob(base64Data.split(“,”)[1]);
} else {
byteString = unescape(base64Data.split(“,”)[1]);
}
const mimeString = base64Data.split(“,”)[0].split(“:”)[1].split(“;”)[0];
const ia = new Uint8Array(byteString.length);
for (let i = 0; i < byteString.length; i++) {
ia[i] = byteString.charCodeAt(i);
}
return new Blob([ia], { type: mimeString });
},
async upload(data) {
// 自定义upload事件
const img = new Image();
img.src = this.file.url;
img.onload = async () => {
let blob;
if(this.file.name.includes(‘gif’)){
await fetch(this.file.url)
.then((response) => response.blo