Error: Invalid base64 input, it looks like a data url. 使用JZip压缩图片时报错 通过正则表达式替换掉多余部分就可以了 replace(/^data:image/(png|jpg);base64,/, ‘’) img.replace(/^data:image\/(png|jpg);base64,/, '')