fix(接口定义): 修复推荐断言小数点位精度丢失问题

--bug=1007658 --user=赵勇 【接口测试】推荐json提取和断言会修改数据精度 https://www.tapd.cn/55049933/s/1063804
This commit is contained in:
fit2-zhao 2021-11-03 17:24:03 +08:00 committed by fit2-zhao
parent 50740e17b4
commit 0209ea07d0
2 changed files with 4 additions and 2 deletions

View File

@ -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;
}

View File

@ -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;