Bläddra i källkod

资料存储加一层目录

wuweihao 3 år sedan
förälder
incheckning
d4d01a7eb3

+ 2 - 2
gis_cms/src/main/java/com/gis/cms/service/impl/ContentServiceImpl.java

@@ -152,7 +152,7 @@ public class ContentServiceImpl extends ServiceImpl<ContentMapper, ContentEntity
         if ("video".equals(type)){
             isPingYing = true;
         }
-        String dir = "/" + param.getVillageId() + "_" + param.getMenuId() + "/" + type;
+        String dir = "/content/" + param.getVillageId() + "_" + param.getMenuId() + "/" + type;
         Map<String, Object> map = fileUtils.uploadMap(param.getFile(), dir, isPingYing);
 
         FileEntity entity = new FileEntity();
@@ -176,7 +176,7 @@ public class ContentServiceImpl extends ServiceImpl<ContentMapper, ContentEntity
         String dirPath;
         // 真删除文件
         for (ContentEntity entity : all) {
-            dirPath = "/" + entity.getVillageId() + "_" + entity.getMenuId();
+            dirPath = "/content/" + entity.getVillageId() + "_" + entity.getMenuId();
             fileUtils.del(dirPath);
         }
         this.removeByIds(idList);