瀏覽代碼

v3场景下载

dengsixing 2 年之前
父節點
當前提交
a36fcace24

+ 4 - 4
src/main/java/com/fdkankan/download/service/impl/SceneDownloadHandlerServiceImpl.java

@@ -345,7 +345,7 @@ public class SceneDownloadHandlerServiceImpl {
             log.info("打包oss文件耗时, num:{}, time:{}", num, timer.intervalRestart());
 
             //重新写入scene.json(去掉密码访问设置)
-            this.zipGetInfoJson(out, this.wwwroot, num, getInfoJson);
+            this.zipGetInfoJson(out, num, getInfoJson);
 
             //写入启动命令
             this.zipBat(out, num, "v3");
@@ -562,10 +562,10 @@ public class SceneDownloadHandlerServiceImpl {
         this.zipBytes(out, sceneJsonPath, sceneJson.toString().getBytes());
     }
 
-    private void zipGetInfoJson(ZipOutputStream out, String root, String num, JSONObject getInfo) throws Exception{
+    private void zipGetInfoJson(ZipOutputStream out, String num, JSONObject getInfo) throws Exception{
 
         //访问密码置0
-        String getInfoKey = root + String.format("data/data%s/", num) + "getInfo.json";
+        String getInfoKey = String.format("data/data%s/", num) + "getInfo.json";
         FileUtil.writeUtf8String(getInfo.toString(), String.format(this.sourceLocal, num, this.wwwroot + getInfoKey));
 //        this.zipBytes(out, getInfoKey, getInfo.toString().getBytes());
     }
@@ -653,7 +653,7 @@ public class SceneDownloadHandlerServiceImpl {
                 .replace("https://smobile.html", "smobile.html");
 
 //            zipBytes(out, prefix + key, content.getBytes());
-            FileUtil.writeUtf8String(content, String.format(sourceLocal, num, this.wwwroot + prefix + key));
+            FileUtil.writeUtf8String(content, String.format(sourceLocal, num, prefix + key));
         }else{
 //            zipBytes(out, prefix + key, FileUtils.getBytesFromUrl(url));
             HttpUtil.downloadFile(url, String.format(sourceLocal, num, prefix + key));