diff --git a/api-test/backend/src/main/java/io/metersphere/commons/utils/JSONUtil.java b/api-test/backend/src/main/java/io/metersphere/commons/utils/JSONUtil.java index 6c47398cb3..f3793436da 100644 --- a/api-test/backend/src/main/java/io/metersphere/commons/utils/JSONUtil.java +++ b/api-test/backend/src/main/java/io/metersphere/commons/utils/JSONUtil.java @@ -46,6 +46,8 @@ public class JSONUtil { // 如果一个对象中没有任何的属性,那么在序列化的时候就会报错 objectMapper.disable(SerializationFeature.FAIL_ON_EMPTY_BEANS); objectMapper.configure(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY, true); + // 使用BigDecimal来序列化 + objectMapper.configure(DeserializationFeature.USE_BIG_DECIMAL_FOR_FLOATS, true); // 设置JSON处理字符长度限制 objectMapper.getFactory() .setStreamReadConstraints(StreamReadConstraints.builder().maxStringLength(JSON.DEFAULT_MAX_STRING_LEN).build()); diff --git a/api-test/frontend/src/business/automation/report/SyncApiReportDetail.vue b/api-test/frontend/src/business/automation/report/SyncApiReportDetail.vue index 978232c3da..a2664d3839 100644 --- a/api-test/frontend/src/business/automation/report/SyncApiReportDetail.vue +++ b/api-test/frontend/src/business/automation/report/SyncApiReportDetail.vue @@ -348,7 +348,7 @@ export default { this.report = response.data || {}; if (response.data) { if (response.data.status === 'RUNNING') { - setTimeout(this.getReport, 5000); + setTimeout(this.getReport, 2000); } else { this.content = JSON.parse(response.data.content); if (!this.content) { @@ -512,7 +512,7 @@ export default { } if (e.data && e.data.indexOf('MS_TEST_END') !== -1) { - this.getReport(); + setTimeout(this.getReport, 3000); this.messageWebSocket.close(); this.cleanHeartBeat(); this.$EventBus.$emit('hide', this.scenarioId); diff --git a/framework/sdk-parent/jmeter/src/main/java/io/metersphere/utils/JsonUtils.java b/framework/sdk-parent/jmeter/src/main/java/io/metersphere/utils/JsonUtils.java index f6ccdda144..1f53f9fb91 100644 --- a/framework/sdk-parent/jmeter/src/main/java/io/metersphere/utils/JsonUtils.java +++ b/framework/sdk-parent/jmeter/src/main/java/io/metersphere/utils/JsonUtils.java @@ -24,6 +24,8 @@ public class JsonUtils { // 如果一个对象中没有任何的属性,那么在序列化的时候就会报错 objectMapper.disable(SerializationFeature.FAIL_ON_EMPTY_BEANS); objectMapper.configure(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY, true); + // 使用BigDecimal来序列化 + objectMapper.configure(DeserializationFeature.USE_BIG_DECIMAL_FOR_FLOATS, true); // 设置JSON处理字符长度限制 objectMapper.getFactory() .setStreamReadConstraints(StreamReadConstraints.builder().maxStringLength(DEFAULT_MAX_STRING_LEN).build()); diff --git a/framework/sdk-parent/sdk/src/main/java/io/metersphere/commons/utils/JSON.java b/framework/sdk-parent/sdk/src/main/java/io/metersphere/commons/utils/JSON.java index 132a55f8cb..15e646788d 100644 --- a/framework/sdk-parent/sdk/src/main/java/io/metersphere/commons/utils/JSON.java +++ b/framework/sdk-parent/sdk/src/main/java/io/metersphere/commons/utils/JSON.java @@ -29,6 +29,8 @@ public class JSON { // 如果一个对象中没有任何的属性,那么在序列化的时候就会报错 objectMapper.disable(SerializationFeature.FAIL_ON_EMPTY_BEANS); objectMapper.configure(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY, true); + // 使用BigDecimal来序列化 + objectMapper.configure(DeserializationFeature.USE_BIG_DECIMAL_FOR_FLOATS, true); // 设置JSON处理字符长度限制 objectMapper.getFactory() .setStreamReadConstraints(StreamReadConstraints.builder().maxStringLength(DEFAULT_MAX_STRING_LEN).build());