fix (接口测试): 执行结果解析错误问题修复
This commit is contained in:
parent
8074a97c13
commit
55eae14754
|
@ -99,8 +99,8 @@ export function saveScenario(url, scenario, scenarioDefinition, _this, success)
|
|||
success(response);
|
||||
}
|
||||
}, error => {
|
||||
_this.$emit('errorRefresh', {});
|
||||
});
|
||||
_this.$emit('errorRefresh', error);
|
||||
},true);
|
||||
}
|
||||
|
||||
export function editApiScenarioCaseOrder(request, callback) {
|
||||
|
|
|
@ -1501,7 +1501,10 @@ export default {
|
|||
this.initMessageSocket();
|
||||
}
|
||||
},
|
||||
errorRefresh() {
|
||||
errorRefresh(error) {
|
||||
if (error && (error + "").indexOf("code 400") !== -1) {
|
||||
this.$warning("步骤内容解析失败,检查是否有已经移除的插件步骤。")
|
||||
}
|
||||
this.debug = false;
|
||||
this.isTop = false;
|
||||
this.debugLoading = false;
|
||||
|
|
|
@ -36,7 +36,6 @@ export default {
|
|||
this.getExecResult();
|
||||
} else {
|
||||
this.response = this.result;
|
||||
// this.isActive = true;
|
||||
}
|
||||
if(this.apiActive){
|
||||
this.isActive = false
|
||||
|
@ -62,10 +61,14 @@ export default {
|
|||
let url = "/api/definition/report/getReport/" + this.apiItem.id;
|
||||
this.$get(url, response => {
|
||||
if (response.data) {
|
||||
try {
|
||||
let data = JSON.parse(response.data.content);
|
||||
this.response = data;
|
||||
this.$set(this.apiItem, 'responseData', data);
|
||||
this.isActive = true;
|
||||
}catch (error){
|
||||
this.isActive = true;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -502,9 +502,13 @@ export default {
|
|||
let url = "/api/definition/report/get/" + apiCase.lastResultId;
|
||||
this.$get(url, response => {
|
||||
if (response.data) {
|
||||
try {
|
||||
let data = JSON.parse(response.data.content);
|
||||
this.response = data;
|
||||
this.resVisible = true;
|
||||
} catch (error) {
|
||||
this.resVisible = true;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -653,9 +657,9 @@ export default {
|
|||
} else if (this.selectDataRange != null) {
|
||||
let selectParamArr = this.selectDataRange.split(":");
|
||||
if (selectParamArr.length === 2) {
|
||||
if(selectParamArr[0] === "single") {
|
||||
if (selectParamArr[0] === "single") {
|
||||
this.condition.id = selectParamArr[1];
|
||||
}else {
|
||||
} else {
|
||||
this.condition.apiDefinitionId = selectParamArr[1];
|
||||
}
|
||||
}
|
||||
|
|
|
@ -360,9 +360,13 @@ export default {
|
|||
let url = "/api/definition/report/get/" + reportId;
|
||||
this.$get(url, response => {
|
||||
if (response.data) {
|
||||
try {
|
||||
let data = JSON.parse(response.data.content);
|
||||
this.response = data;
|
||||
this.visible = true;
|
||||
} catch (error) {
|
||||
this.visible = true;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -107,7 +107,7 @@ export function post(url, data, success, failure) {
|
|||
}
|
||||
}
|
||||
|
||||
export function request(axiosRequestConfig, success, failure) {
|
||||
export function request(axiosRequestConfig, success, failure, hideError) {
|
||||
let result = {loading: true};
|
||||
if (!success) {
|
||||
return axios.request(axiosRequestConfig);
|
||||
|
@ -115,7 +115,9 @@ export function request(axiosRequestConfig, success, failure) {
|
|||
axios.request(axiosRequestConfig).then(response => {
|
||||
then(success, response, result);
|
||||
}).catch(error => {
|
||||
if (!hideError) {
|
||||
exception(error, result);
|
||||
}
|
||||
if (failure) {
|
||||
then(failure, error, result);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue