wj 4 лет назад
Родитель
Сommit
ef6c12e72e

+ 1 - 1
common-core/src/main/java/com/tofly/common/core/util/PasswordUtil.java

@@ -12,7 +12,7 @@ import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
 public class PasswordUtil {
     public static String passwordEncode(String password){
         BCryptPasswordEncoder bCryptPasswordEncoder = new BCryptPasswordEncoder();
-        log.info("用{}加密后的密码为:{}", SecurityConstants.BCRYPT+password,bCryptPasswordEncoder.encode(SecurityConstants.BCRYPT+password));
+//        log.info("用{}加密后的密码为:{}", SecurityConstants.BCRYPT+password,bCryptPasswordEncoder.encode(SecurityConstants.BCRYPT+password));
         return bCryptPasswordEncoder.encode(SecurityConstants.BCRYPT+password);
     }
 }

+ 17 - 1
common-file-ftp/src/main/java/com/tofly/common/ftp/config/FtpUtil.java

@@ -96,6 +96,8 @@ public class FtpUtil {
         FTPClient ftpClient = getFtpClient();
         try (InputStream in = ftpClient.retrieveFileStream(encodingPath(remoteFilePath));
              BufferedReader br = new BufferedReader(new InputStreamReader(in))) {
+            in.close();
+            ftpClient.completePendingCommand();
             return br.lines().map(line -> StringUtils.trimToEmpty(line))
                     .filter(line -> StringUtils.isNotEmpty(line)).collect(Collectors.toList());
         } finally {
@@ -232,6 +234,8 @@ public class FtpUtil {
         try (OutputStream out = ftpClient.storeFileStream(encodingPath(remoteFilePath))) {
             workbook.write(out);
             workbook.close();
+            out.close();
+            ftpClient.completePendingCommand();
             return true;
         } finally {
             //ftpClient.completePendingCommand();
@@ -246,6 +250,8 @@ public class FtpUtil {
         FTPClient ftpClient = getFtpClient();
         try (OutputStream out = ftpClient.storeFileStream(encodingPath(remoteFilePath))) {
             out.write(bytes);
+            out.close();
+            ftpClient.completePendingCommand();
             return true;
         } finally {
             //ftpClient.completePendingCommand();
@@ -408,6 +414,9 @@ public class FtpUtil {
                 out.write(buf, 0, size);
                 out.flush();
             }
+            out.close();
+            in.close();
+            ftpClient.completePendingCommand();
         } finally {
             //ftpClient.completePendingCommand();
             releaseFtpClient(ftpClient);
@@ -422,6 +431,8 @@ public class FtpUtil {
         InputStream in;
         try {
              in = ftpClient.retrieveFileStream(encodingPath(remoteFilePath));
+            in.close();
+            ftpClient.completePendingCommand();
         }finally {
             //ftpClient.completePendingCommand();
             releaseFtpClient(ftpClient);
@@ -452,8 +463,10 @@ public class FtpUtil {
                     out.flush();
                 }
                 flieByte = out.toByteArray();
+                out.close();
+                in.close();
+                ftpClient.completePendingCommand();
             } finally {
-                //ftpClient.completePendingCommand();
                 releaseFtpClient(ftpClient);
             }
         }
@@ -482,6 +495,9 @@ public class FtpUtil {
                 out.write(buf, 0, size);
                 out.flush();
             }
+            out.close();
+            in.close();
+            ftpClient.completePendingCommand();
         } finally {
             //ftpClient.completePendingCommand();
             releaseFtpClient(ftpClient);