// 读取url转为base64

urlContentToDataUri(url) {
return fetch(url)
.then(response => response.blob())
.then(blob => new Promise(callback => {
let reader = new FileReader();
reader.onload = function () {
callback(this.result.split(',')[1]);
};
reader.readAsDataURL(blob);
}));
},

posted on 2023-05-19 10:05  IT丶Hatcher  阅读(153)  评论(0)    收藏  举报

导航