diff --git a/backend/src/main/java/io/metersphere/commons/utils/ShiroUtils.java b/backend/src/main/java/io/metersphere/commons/utils/ShiroUtils.java index 27430e98ae..78c1d168fc 100644 --- a/backend/src/main/java/io/metersphere/commons/utils/ShiroUtils.java +++ b/backend/src/main/java/io/metersphere/commons/utils/ShiroUtils.java @@ -25,6 +25,7 @@ public class ShiroUtils { filterChainDefinitionMap.put("/favicon.ico", "anon"); filterChainDefinitionMap.put("/display/file/**", "anon"); filterChainDefinitionMap.put("/jmeter/download/**", "anon"); + filterChainDefinitionMap.put("/jmeter/ping", "anon"); filterChainDefinitionMap.put("/authsource/list/allenable", "anon"); filterChainDefinitionMap.put("/sso/signin", "anon"); filterChainDefinitionMap.put("/sso/callback", "anon"); diff --git a/backend/src/main/java/io/metersphere/performance/controller/JmeterFileController.java b/backend/src/main/java/io/metersphere/performance/controller/JmeterFileController.java index f39070d3b8..6ad3c39089 100644 --- a/backend/src/main/java/io/metersphere/performance/controller/JmeterFileController.java +++ b/backend/src/main/java/io/metersphere/performance/controller/JmeterFileController.java @@ -18,6 +18,11 @@ public class JmeterFileController { @Resource private JmeterFileService jmeterFileService; + @GetMapping("ping") + public String checkStatus() { + return "PONG"; + } + @GetMapping("download") public ResponseEntity downloadJmeterFiles(@RequestParam("testId") String testId, @RequestParam("resourceId") String resourceId, @RequestParam("ratio") double ratio, @RequestParam("startTime") long startTime, diff --git a/backend/src/main/java/io/metersphere/performance/engine/docker/DockerTestEngine.java b/backend/src/main/java/io/metersphere/performance/engine/docker/DockerTestEngine.java index c59a8664e1..eb28578592 100644 --- a/backend/src/main/java/io/metersphere/performance/engine/docker/DockerTestEngine.java +++ b/backend/src/main/java/io/metersphere/performance/engine/docker/DockerTestEngine.java @@ -74,14 +74,14 @@ public class DockerTestEngine extends AbstractEngine { BaseSystemConfigDTO baseInfo = CommonBeanFactory.getBean(SystemParameterService.class).getBaseInfo(); KafkaProperties kafkaProperties = CommonBeanFactory.getBean(KafkaProperties.class); JmeterProperties jmeterProperties = CommonBeanFactory.getBean(JmeterProperties.class); - String metersphereUrl = "http://localhost:8081"; + String metersphereUrl = "http://localhost:8081"; // 占位符 if (baseInfo != null) { metersphereUrl = baseInfo.getUrl(); } - + String jmeterPingUrl = metersphereUrl + "/jmeter/ping"; // 检查下载地址是否正确 // docker 不能从 localhost 中下载文件 if (StringUtils.contains(metersphereUrl, "http://localhost") - || !UrlTestUtils.testUrlWithTimeOut(metersphereUrl, 1000)) { + || !UrlTestUtils.testUrlWithTimeOut(jmeterPingUrl, 1000)) { MSException.throwException(Translator.get("run_load_test_file_init_error")); } diff --git a/backend/src/main/java/io/metersphere/xpack b/backend/src/main/java/io/metersphere/xpack index b9042074b7..611c38a8b0 160000 --- a/backend/src/main/java/io/metersphere/xpack +++ b/backend/src/main/java/io/metersphere/xpack @@ -1 +1 @@ -Subproject commit b9042074b780205e275c674f64417799110519fd +Subproject commit 611c38a8b0db7180ea4d4c8ace749ac25499672d