|
@@ -1046,6 +1046,9 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
//如果是单张图片,直接提供oss url
|
|
|
String localFilePath = localImagesPath + fileName;
|
|
|
String ossFilePath = imgCachePath + fileName;
|
|
|
+ if(!cn.hutool.core.io.FileUtil.exist(localFilePath)){
|
|
|
+ throw new BusinessException(ErrorCode.FAILURE_CODE_5063);
|
|
|
+ }
|
|
|
uploadToOssUtil.upload(localFilePath, ossFilePath);
|
|
|
url = ossUrlPrefix + ossFilePath;
|
|
|
// FileUtils.downLoadFromUrl(imageUrl, fileName, localImagesPath);
|
|
@@ -1067,8 +1070,9 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
// }
|
|
|
// });
|
|
|
// }
|
|
|
- if(!cn.hutool.core.io.FileUtil.exist(localImagesPath)){
|
|
|
- throw new BusinessException(ErrorCode.FAILURE_CODE_7006);
|
|
|
+ if(!cn.hutool.core.io.FileUtil.exist(localImagesPath)
|
|
|
+ || cn.hutool.core.io.FileUtil.isDirEmpty(new File(localImagesPath))){
|
|
|
+ throw new BusinessException(ErrorCode.FAILURE_CODE_5063);
|
|
|
}
|
|
|
|
|
|
downloadName = num + "_images.zip";
|