Browse Source

!126 修复启用反代后压缩包 解压后找不到路径
Merge pull request !126 from 高雄

陈精华 1 year ago
parent
commit
65af89d711
1 changed files with 4 additions and 1 deletions
  1. 4 1
      server/src/main/java/cn/keking/service/FileHandlerService.java

+ 4 - 1
server/src/main/java/cn/keking/service/FileHandlerService.java

@@ -329,7 +329,10 @@ public class FileHandlerService {
             suffix = WebUtils.suffixFromUrl(url);
         }
         if (url.contains("?fileKey=")) {
-            fileName = urlStrr;
+            String[] strs = url.split("=");  //处理解压后有反代情况下 文件的路径
+            String  urlStrr = getSubString(url, strs[1]);
+            urlStrr =  urlStrr.substring(0,urlStrr.lastIndexOf("?"));
+            fileName = strs[1] + urlStrr.trim();
             attribute.setSkipDownLoad(true);
         }
         // System.out.println(fileName);