fix(接口测试): 修复推荐提取数字显示精确度错误问题
--bug=1009465 --user=赵勇 [github#9090]JSONPath提取器数据精度丢失 https://www.tapd.cn/55049933/s/1090126
This commit is contained in:
parent
09a4129dd6
commit
9d085402f1
|
@ -125,6 +125,7 @@ export default {
|
|||
this.fullTreeNodes = [];
|
||||
this.failsTreeNodes = [];
|
||||
this.isRequestResult = false;
|
||||
this.activeName = "total";
|
||||
},
|
||||
handleClick(tab, event) {
|
||||
this.isRequestResult = false;
|
||||
|
|
|
@ -28,11 +28,13 @@ const clickoutside = {
|
|||
binding.value(e)
|
||||
}
|
||||
}
|
||||
|
||||
// 给当前元素绑定个私有变量,方便在unbind中可以解除事件监听
|
||||
el.__vueClickOutside__ = documentHandler
|
||||
document.addEventListener('click', documentHandler)
|
||||
},
|
||||
update () { },
|
||||
update() {
|
||||
},
|
||||
unbind(el, binding) {
|
||||
// 解除事件监听
|
||||
document.removeEventListener('click', el.__vueClickOutside__)
|
||||
|
@ -67,9 +69,8 @@ export default {
|
|||
this.data = {};
|
||||
try {
|
||||
// 解决精度丢失问题
|
||||
// let stringedJSON = objStr.replace(/:\s*([-+Ee0-9.]+)/g, ': "$1"');
|
||||
// 一些情况会解析失败,先注释掉
|
||||
let param = JSON.parse(objStr);
|
||||
let JSONBig = require('json-bigint')({"storeAsString": true});
|
||||
let param = JSON.parse(JSON.stringify(JSONBig.parse(objStr)));
|
||||
if (param instanceof Array) {
|
||||
this.$warning('不支持解析JSON数组');
|
||||
return;
|
||||
|
|
Loading…
Reference in New Issue