|
@@ -49,14 +49,16 @@ public class ImageUploadUtils {
|
|
|
if(!StringUtils.isEmpty(imgStr)){
|
|
|
JSONObject jsStr = JSONObject.parseObject(imgStr);
|
|
|
imgStr = (String)jsStr.get("imgStr");
|
|
|
+ logger.info("-----imgStr:"+imgStr);
|
|
|
if(imgStr.contains(",")){
|
|
|
- String[] split = imgStr.split(",");
|
|
|
+ String[] split = imgStr.split("base64,");
|
|
|
String s = split[0];//data:image/png;base64
|
|
|
String imgStrType = ".jpg";
|
|
|
if(s.contains("image/")){
|
|
|
imgStrType="." + s.substring(s.indexOf("image/")+1, s.indexOf(";"));
|
|
|
}
|
|
|
imgStr = split[1];
|
|
|
+ logger.info("-----imgStr1:"+imgStr);
|
|
|
try {
|
|
|
String filepath = GenerateImage(imgStr,imgStrType);//解析编码
|
|
|
String result = client.uploadFile(filepath);
|