Compare commits

..

2 Commits

@ -419,7 +419,7 @@ public class AppController extends BaseController
tImage.setThirdId(recordId); tImage.setThirdId(recordId);
tImage.setCreateTime(new Date()); tImage.setCreateTime(new Date());
tImage.setName(name); tImage.setName(name);
String path=GenerateImage(value); String path=GenerateImage(value,name);
tImage.setPath(path); tImage.setPath(path);
imageService.insertTImage(tImage); imageService.insertTImage(tImage);
} }
@ -465,7 +465,7 @@ public class AppController extends BaseController
{ {
String imageKey=keys[i]; String imageKey=keys[i];
String imgStr=parents.get(i).getJSONObject(imageKey).getString("v"); String imgStr=parents.get(i).getJSONObject(imageKey).getString("v");
String path=GenerateImage(imgStr); String path=GenerateImage(imgStr,imageKey);
parents.get(i).getJSONObject(keys[i]).put("v",null); parents.get(i).getJSONObject(keys[i]).put("v",null);
TImage tImage = new TImage(); TImage tImage = new TImage();
tImage.setName(imageKey); tImage.setName(imageKey);
@ -495,7 +495,7 @@ public class AppController extends BaseController
} }
public static String GenerateImage(String imgStr) public static String GenerateImage(String imgStr,String imageName)
{ {
BASE64Decoder decoder = new BASE64Decoder(); BASE64Decoder decoder = new BASE64Decoder();
@ -515,7 +515,7 @@ public class AppController extends BaseController
} }
catch (Exception e) catch (Exception e)
{ {
throw new ServiceException("Base64转图片错误"); throw new ServiceException(imageName + " :Base64转图片错误");
} }
} }
} }

@ -77,6 +77,9 @@ public class CommonController
{ {
try try
{ {
if(file == null){
return AjaxResult.error("上传文件为空");
}
// 上传文件路径 // 上传文件路径
String filePath = RuoYiConfig.getUploadPath(); String filePath = RuoYiConfig.getUploadPath();
// 上传并返回新文件名称 // 上传并返回新文件名称

Loading…
Cancel
Save