1.图片转Base64字符串时,前面会生成如下图的前缀。 在转回图片时,需去除前缀。 String str = text.substring(text.indexOf(",")+1); //text为base64字符串