canvas 导出海报报 SecurityError 跨域图片不设 CORS 头怎么改 陆零云 2026-11-14 09:39:52 30 0 活动海报页要把商品图、二维码和标题拼成一张图给用户保存,导出走 canvas.toDataURL('image/png')。上线第二天运营反馈部分用户点了没反应,控制台一行红字:Uncaught SecurityError: Failed to execute 'toDataURL' on 'HTMLCanvasElement': Tainted canvases may not be exported. 同源的商品图没事,只有 CDN 那批图会把画布画脏...