diff --git a/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/FTPUtil.java b/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/FTPUtil.java index c40d9edb..62a8b729 100644 --- a/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/FTPUtil.java +++ b/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/FTPUtil.java @@ -47,12 +47,12 @@ public class FTPUtil { //声明FTP客户端 FTPClient ftp = new FTPClient(); try { - // 切换为本地被动模式,可以解决FTP上传后文件为空的问题,但需要服务器将FTP服务添加至防火墙白名单 - ftp.enterLocalPassiveMode(); //连接 ftp.connect(host, port); //登录 ftp.login(userName, password); + // 切换为本地被动模式,可以解决FTP上传后文件为空的问题,但需要服务器将FTP服务添加至防火墙白名单 + ftp.enterLocalPassiveMode(); //判断是否连接成功 int reply = ftp.getReplyCode(); if (!FTPReply.isPositiveCompletion(reply)) {