前言:uniapp+vue项目,调用uni.canvasToTempFilePath方法绘制画布,报错:
"canvasToTempFilePath:fail SecurityError: Failed to execute 'toDataURL' on 'HTMLCanvasElement': Tainted canvases may not be exported."
“canvasToTempFilePath:fail SecurityError:无法在“HTMLCanvasElement”上执行“toDataURL”:可能无法导出已损坏的画布。”
原因:图片文件跨域。
解决方案:需要把跨域的图片设置成允许跨域。
标签:HTMLCanvasElement,canvases,execute,Failed,canvasToTempFilePath,toDataURL,fail,Se From: https://www.cnblogs.com/iuniko/p/16737985.html