之前遇到的小问题,记录一下,仅此而已。
```
private static String imgToBase64(String path) {
try {
HttpResponse response = HttpRequest.get(path).execute();
if ( null == response) {
throw new BizException(CosmosResultCodeEnum.BIZ_FAIL);
}
return "data:image/jpeg;base64," + Base64.encodeBase64String(response.bodyBytes());
} catch (Exception e) {
throw new BuisnessException(CosmosResultCodeEnum.BIZ_FAIL);
}
}
```

图片转为 base64编码