|
|
@@ -96,7 +96,7 @@ public class CaseDownService {
|
|
|
return downVo;
|
|
|
}
|
|
|
@Async
|
|
|
- public void downOffline(Integer caseId){
|
|
|
+ public void downOffline(Integer caseId,String fromRoute){
|
|
|
String caseOffPath = null;
|
|
|
String zipName = null;
|
|
|
try {
|
|
|
@@ -113,7 +113,7 @@ public class CaseDownService {
|
|
|
|
|
|
setRedisProcess(caseId,0);
|
|
|
//复制前端资源
|
|
|
- cpIndexHtml(caseId,caseOffPath);
|
|
|
+ cpIndexHtml(caseId,caseOffPath,fromRoute);
|
|
|
setRedisProcess(caseId,10);
|
|
|
//创建data.json并下载资源
|
|
|
createDataJson(caseId,caseOffPath+"/www");
|
|
|
@@ -282,20 +282,14 @@ public class CaseDownService {
|
|
|
//http://127.0.0.1:8080/offline.html?caseId=362&app=1&share=1#/show/summary
|
|
|
|
|
|
static String batName = "start-browser.bat";
|
|
|
- public void cpIndexHtml(Integer caseId,String casePath){
|
|
|
+ public void cpIndexHtml(Integer caseId,String casePath,String fromRoute){
|
|
|
log.info("down-offline-cpIndexHtml:{}",caseId);
|
|
|
|
|
|
FileUtil.copyContent(new File(FilePath.OFFLINE_TEMPLATE_PATH_CASE),new File(casePath),true);
|
|
|
|
|
|
String s = FileUtil.readString(casePath + File.separator + batName, StandardCharsets.UTF_8);
|
|
|
String s1 = s.replaceAll("@caseId", String.valueOf(caseId));
|
|
|
-
|
|
|
- CaseEntity caseEntity = caseService.getById(caseId);
|
|
|
- if(caseEntity.getTmProjectId() == null){
|
|
|
- s1 = s1.replaceAll("app=1", "app=2");
|
|
|
- s1 = s1.replaceAll("isSample=0", "isSample=1");
|
|
|
- }
|
|
|
-
|
|
|
+ s1 = s1.replaceAll("@fromRoute", fromRoute);
|
|
|
FileUtil.writeString(s1, casePath + File.separator + batName,"UTF-8");
|
|
|
}
|
|
|
|