/** * database64文件格式转换为2进制 * * @param {[String]} data The format of the dataURL is "data:image/png;base64,****". The comma is preceded by some descriptive text. We only need the comma after the line. * @param {[String]} mime [description] * @return {[blob]} [description] */exportdefaultfunction(data,mime){data=data.split(',')[1];data=window.atob(data);varia=newUint8Array(data.length);for(vari=0;i<data.length;i++){ia[i]=data.charCodeAt(i);}// The default format returned by canvas.toDataURL is image/pngreturnnewBlob([ia],{type:mime,});}