haogh 7 сар өмнө
parent
commit
4e958eba88

+ 1 - 1
src/main/java/com/qmth/exam/reserve/service/impl/StudentServiceImpl.java

@@ -361,7 +361,7 @@ public class StudentServiceImpl extends ServiceImpl<StudentDao, StudentEntity> i
             throw new StatusException("考生照片必须以考生的身份证命名");
         }
 
-        StringJoiner stringJoiner = FileUtil.getDirName(FileUploadType.UPLOAD, true);
+        StringJoiner stringJoiner = FileUtil.getDirName(false);
         String path = stringJoiner.toString().replaceAll("\\\\", "/");
 
         try {

+ 7 - 3
src/main/java/com/qmth/exam/reserve/util/FileUtil.java

@@ -113,10 +113,14 @@ public class FileUtil {
         return stringJoiner;
     }
 
-    public static void main(String[] args) {
-        StringJoiner dirName = getDirName(FileUploadType.UPLOAD, true);
-        System.out.println(dirName.toString());
+    public static StringJoiner getDirName(boolean fileSeparate) {
+        StringJoiner stringJoiner = new StringJoiner("");
+        if (fileSeparate) {
+            stringJoiner.add(File.separator);
+        }
+        return stringJoiner;
     }
 
 
+
 }