修复GetAndSaveFile方法,生成的下载文件路径不正确的问题

This commit is contained in:
seagull 2020-11-10 19:31:27 +08:00
parent cd93d340e2
commit 9256a564af
3 changed files with 12 additions and 5 deletions

View File

@ -4,7 +4,7 @@
<groupId>LuckyFrameClient</groupId>
<artifactId>LuckyFrameClient</artifactId>
<version>3.3</version>
<version>3.4</version>
<packaging>jar</packaging>
<name>LuckyFrameClient</name>
@ -166,7 +166,7 @@
<dependency>
<groupId>commons-beanutils</groupId>
<artifactId>commons-beanutils</artifactId>
<version>1.9.3</version>
<version>1.9.4</version>
</dependency>
<dependency>
<groupId>commons-cli</groupId>
@ -185,7 +185,7 @@
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-compress</artifactId>
<version>1.13</version>
<version>1.19</version>
</dependency>
<dependency>
<groupId>commons-configuration</groupId>

View File

@ -1,5 +1,5 @@
#===============================系统配置=====================================
client.verison=3.3
client.verison=3.4
client.name=测试客户端
server.web.ip=localhost
server.web.port=80

View File

@ -8,6 +8,8 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import cn.hutool.core.date.DatePattern;
import cn.hutool.core.date.DateUtil;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
@ -225,7 +227,12 @@ public class InvokeMethod {
break;
case "getandsavefile":
String fileSavePath = RunService.APPLICATION_HOME + "\\HTTPSaveFile\\";
result = hct.sendGetAndSaveFile(packagename, params, fileSavePath, headmsg, ppt);
File file = new File(fileSavePath);
if (!file.exists()) {
file.mkdirs();
}
String time = DateUtil.format(DateUtil.date(), DatePattern.PURE_DATETIME_PATTERN);
result = hct.sendGetAndSaveFile(packagename, params, fileSavePath+time, headmsg, ppt);
break;
case "httpurlget":
result = hct.sendHttpURLGet(packagename, params, headmsg, ppt);