diff --git a/backend/src/main/java/io/metersphere/api/service/ApiAutomationService.java b/backend/src/main/java/io/metersphere/api/service/ApiAutomationService.java index c4e48a447d..0862d57260 100644 --- a/backend/src/main/java/io/metersphere/api/service/ApiAutomationService.java +++ b/backend/src/main/java/io/metersphere/api/service/ApiAutomationService.java @@ -1641,10 +1641,10 @@ public class ApiAutomationService { public ReferenceDTO getReference(ApiScenarioRequest request) { ReferenceDTO dto = new ReferenceDTO(); + request.setProjectId(null); dto.setScenarioList(extApiScenarioMapper.selectReference(request)); QueryTestPlanRequest planRequest = new QueryTestPlanRequest(); planRequest.setScenarioId(request.getId()); - planRequest.setProjectId(request.getProjectId()); dto.setTestPlanList(extTestPlanMapper.selectTestPlanByRelevancy(planRequest)); return dto; } diff --git a/frontend/src/business/components/api/definition/components/assertion/ApiJsonpathSuggest.vue b/frontend/src/business/components/api/definition/components/assertion/ApiJsonpathSuggest.vue index 4325ad5cc4..077524e7e5 100644 --- a/frontend/src/business/components/api/definition/components/assertion/ApiJsonpathSuggest.vue +++ b/frontend/src/business/components/api/definition/components/assertion/ApiJsonpathSuggest.vue @@ -66,7 +66,9 @@ export default { open(objStr) { this.data = {}; try { - let param = JSON.parse(objStr); + // 解决精度丢失问题 + let stringedJSON = objStr.replace(/:\s*([-+Ee0-9.]+)/g, ': "$1"'); + let param = JSON.parse(stringedJSON); if (param instanceof Array) { this.$warning(this.$t('api_test.request.assertions.json_path_err')); return;