function convertImgToBase64(url, callback, outputFormat) {
var img = new Image;
img.crossOrigin = "Anonymous"; //跨域
img.src = url;
img.onload = function () {
var canvas = document.createElement('CANVAS');
var ctx = canvas.getContext('2d');
canvas.height = img.height;
canvas.width = img.width;
ctx.drawImage(img, 0, 0);
var dataURL = canvas.toDataURL(outputFormat || 'image/png');
callback.call(this, dataURL);
canvas = null;
};
},