base64字符串图片显示
2020-06-10 本文已影响0人
超级笔记本
- 后端将字节数组经过base64编码,返回字符串
byte[] bytes = xxx;
...
BASE64Encoder encoder = new BASE64Encoder();
return encoder.encode(bytes);
- 前端通过拼接字符串,赋值给img得src
src = “data:image/png;base64," + res;