解决 canvas 将图片转为base64报错: Uncaught DOMException: Failed to execute 'toDataURL' on 'HTMLCanvasElement'
产生原因 图片跨域
解决办法 图片顺序下 蓝色字体即可
img = new Image()
img.setAttribute("crossOrigin",'Anonymous')
img.src = sourceImgUrl
img.onload = function() {}
往后就好了