Explorar el Código

全景图资源被删除,下载全景图提示下载失败

dengsixing hace 3 años
padre
commit
64894807d6

+ 6 - 2
4dkankan-center-scene/src/main/java/com/fdkankan/scene/service/impl/SceneEditInfoServiceImpl.java

@@ -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";