浏览器如何下载base64字符串格式的图片
解决方法:
其中qr是下载文件的名称,save_link.hre就是图片的base64字符串文本
var save_link = document.createElementNS('http://www.w3.org/1999/xhtml', 'a');
save_link.href ="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASwAAAH0C"
save_link.download = 'qr';
var event = document.createEvent('MouseEvents');
event.initEvent('click', true, false, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
save_link.dispatchEvent(event);