Просмотр исходного кода

优化调试内容 图片有的显示有点不显示问题

java110 лет назад: 5
Родитель
Сommit
54374433d3

+ 4 - 0
CommonService/src/main/java/com/java110/common/smo/impl/FileInnerServiceSMOImpl.java

@@ -67,6 +67,10 @@ public class FileInnerServiceSMOImpl extends BaseServiceSMO implements IFileInne
                 java110Properties.getFtpUserPassword());
         try {
             File file = new File("/home/hc/img/"+ UUID.randomUUID().toString()+".jpg");
+            File fileParent = file.getParentFile();
+            if (!fileParent.exists()) {
+                fileParent.mkdirs();// 能创建多级目录
+            }
             if(!file.exists()){
                 file.createNewFile();
             }