提交 0c25e290 authored 作者: yangli's avatar yangli

.

上级 7980d5e2
...@@ -35,7 +35,9 @@ public class ConfigController { ...@@ -35,7 +35,9 @@ public class ConfigController {
@GetMapping(value = "get_download_path") @GetMapping(value = "get_download_path")
public R<String> getDownloadPath() throws IOException { public R<String> getDownloadPath() throws IOException {
String path = SysConfigUtil.getProperty("download.path", String path = SysConfigUtil.getProperty("download.path",
System.getProperty("user.home") + File.separator + "Downloads"); System.getProperty("user.dir").substring(0, 3) + "apqdownloads");
File dir = new File(path);
if (!dir.exists()) dir.mkdirs();
return R.success(path); return R.success(path);
} }
......
...@@ -135,7 +135,7 @@ public class ProgramController { ...@@ -135,7 +135,7 @@ public class ProgramController {
@RequestParam @NotBlank String url, @RequestParam @NotBlank String url,
HttpServletResponse response) throws IOException { HttpServletResponse response) throws IOException {
File dir = new File(SysConfigUtil.getProperty("download.path", File dir = new File(SysConfigUtil.getProperty("download.path",
System.getProperty("user.home") + File.separator + "Downloads")); System.getProperty("user.dir").substring(0, 3) + "apqdownloads"));
if (!dir.exists()) dir.mkdirs(); if (!dir.exists()) dir.mkdirs();
HttpResponse rsp = HttpUtil.createGet(url).execute(true); HttpResponse rsp = HttpUtil.createGet(url).execute(true);
double length = rsp.contentLength(); double length = rsp.contentLength();
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论