|
@@ -97,10 +97,16 @@ public class PhotoServiceImpl extends BaseService implements PhotoService {
|
|
|
|
|
|
try {
|
|
|
UploadUtil.upload(photoDto.getPhoto(), filePath);
|
|
|
+
|
|
|
} catch (IOException ioe) {
|
|
|
log.error("图片上传失败,失败原因:{}", ioe.getMessage());
|
|
|
throw new ServiceException("图片上传失败");
|
|
|
}
|
|
|
+ File dest = new File(filePath);
|
|
|
+ if (!dest.getParentFile().exists()) {
|
|
|
+ log.error("图片上传失败,失败原因:服务器图片不存在");
|
|
|
+ throw new ServiceException("图片上传失败");
|
|
|
+ }
|
|
|
|
|
|
photoDto.setUrl(File.separator + fileName);
|
|
|
PhotoPo photoPo = new PhotoPo();
|