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