fix(接口测试): 修复插件调试执行结果不显示问题

This commit is contained in:
fit2-zhao 2022-01-17 16:24:13 +08:00 committed by fit2-zhao
parent c44af2f3d1
commit a878688929
2 changed files with 4 additions and 2 deletions

View File

@ -162,8 +162,9 @@ export default {
if (item.enable) {
item.parentIndex = fullPath ? fullPath + "_" + item.index : item.index;
let name = item.name ? item.name : this.getType(item.type);
let id = item.type === 'JSR223Processor' || !item.id ? item.resourceId : item.id
let obj = {
pid: pid, resId: (item.type === 'JSR223Processor' ? item.resourceId : item.id) + "_" + item.parentIndex, index: Number(item.index), label: name,
pid: pid, resId: id + "_" + item.parentIndex, index: Number(item.index), label: name,
value: {name: name, responseResult: {}, unexecute: true, testing: false}, children: [], unsolicited: true
};
tree.children.push(obj);

View File

@ -841,7 +841,8 @@ export default {
if (e.data && e.data.startsWith("result_")) {
let data = JSON.parse(e.data.substring(7));
this.reqTotal += 1;
this.reqTotalTime += (data.endTime - data.startTime);
let time = data.endTime - data.startTime;
this.reqTotalTime += time > 0 ? time : 0;
if (data.error === 0) {
this.reqSuccess += 1;
} else {