|
@@ -22,6 +22,7 @@ import com.fdkankan.fusion.service.*;
|
|
import com.fdkankan.fusion.service.impl.DownService;
|
|
import com.fdkankan.fusion.service.impl.DownService;
|
|
import com.fdkankan.redis.util.RedisUtil;
|
|
import com.fdkankan.redis.util.RedisUtil;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
+import org.apache.commons.io.FileUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
@@ -30,6 +31,8 @@ import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.io.File;
|
|
import java.io.File;
|
|
import java.io.FileOutputStream;
|
|
import java.io.FileOutputStream;
|
|
|
|
+import java.io.IOException;
|
|
|
|
+import java.io.InputStream;
|
|
import java.nio.charset.StandardCharsets;
|
|
import java.nio.charset.StandardCharsets;
|
|
import java.util.Date;
|
|
import java.util.Date;
|
|
import java.util.HashSet;
|
|
import java.util.HashSet;
|
|
@@ -353,10 +356,14 @@ public class CaseDownService {
|
|
//http://127.0.0.1:8080/offline.html?caseId=362&app=1&share=1#/show/summary
|
|
//http://127.0.0.1:8080/offline.html?caseId=362&app=1&share=1#/show/summary
|
|
|
|
|
|
static String batName = "start-browser.bat";
|
|
static String batName = "start-browser.bat";
|
|
- public void cpIndexHtml(Integer caseId,String caseOffPath){
|
|
|
|
|
|
+ public void cpIndexHtml(Integer caseId,String caseOffPath) throws IOException {
|
|
log.info("down-offline-cpIndexHtml:{}",caseOffPath);
|
|
log.info("down-offline-cpIndexHtml:{}",caseOffPath);
|
|
-
|
|
|
|
- FileUtil.copyContent(new File(FilePath.OFFLINE_TEMPLATE_PATH),new File(caseOffPath),true);
|
|
|
|
|
|
+ File file = new File(FilePath.OFFLINE_TEMPLATE_PATH);
|
|
|
|
+ if(!file.exists()){
|
|
|
|
+ InputStream inputStream = this.getClass().getClassLoader().getResourceAsStream("static/offline/template");
|
|
|
|
+ FileUtils.copyInputStreamToFile(inputStream,file);
|
|
|
|
+ }
|
|
|
|
+ FileUtil.copyContent(file,new File(caseOffPath),true);
|
|
|
|
|
|
String s = FileUtil.readString(caseOffPath + File.separator + batName, StandardCharsets.UTF_8);
|
|
String s = FileUtil.readString(caseOffPath + File.separator + batName, StandardCharsets.UTF_8);
|
|
String s1 = s.replaceAll("@caseId", String.valueOf(caseId));
|
|
String s1 = s.replaceAll("@caseId", String.valueOf(caseId));
|