diff --git a/api-test/frontend/src/business/definition/components/assertion/ApiJsonpathSuggest.vue b/api-test/frontend/src/business/definition/components/assertion/ApiJsonpathSuggest.vue index 0a6e31b53d..3539291c59 100644 --- a/api-test/frontend/src/business/definition/components/assertion/ApiJsonpathSuggest.vue +++ b/api-test/frontend/src/business/definition/components/assertion/ApiJsonpathSuggest.vue @@ -73,7 +73,7 @@ export default { open(objStr) { this.data = {}; try { - let stringedJSON = objStr.replace(/:\s*([-+Ee0-9.]+)/g, ': "$1"'); + let stringedJSON = objStr.replace(/:\s*(?!.*\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}\+\d{2}:\d{2})\s([-+Ee0-9.]+)/g, ': "$1"'); let param; let JSONBig = require('json-bigint')({ storeAsString: true }); // 解决精度丢失问题 diff --git a/framework/sdk-parent/frontend/src/components/environment/assertion/ApiJsonpathSuggest.vue b/framework/sdk-parent/frontend/src/components/environment/assertion/ApiJsonpathSuggest.vue index 651e7c04f7..baa3cec1b3 100644 --- a/framework/sdk-parent/frontend/src/components/environment/assertion/ApiJsonpathSuggest.vue +++ b/framework/sdk-parent/frontend/src/components/environment/assertion/ApiJsonpathSuggest.vue @@ -69,7 +69,7 @@ export default { open(objStr) { this.data = {}; try { - let stringedJSON = objStr.replace(/:\s*([-+Ee0-9.]+)/g, ': "$1"'); + let stringedJSON = objStr.replace(/:\s*(?!.*\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}\+\d{2}:\d{2})\s([-+Ee0-9.]+)/g, ': "$1"'); let param; let JSONBig = require('json-bigint')({"storeAsString": true}); // 解决精度丢失问题