Base64转为Blob
base64ToBlob(fileBase64,fileType){
let raw = window.atob(fileBase64);
let rawLength = raw.length;
let uint8Array = new Uint8Array(rawLength);
while (rawLength--){
uint8Array[rawLength] = raw.charCodeAt(rawLength);
}
return new Blob([uint8Array],{type: fileType});
}
Blob转为Base64
blobToBase64(blob,callback) {
let reader = new FileReader();
reader.onload = function (e) {
callback(e.target.result);
}
reader.readAsDataURL(blob);
}