fix(接口自动化): 部分缺陷修复

This commit is contained in:
fit2-zhao 2020-12-16 19:23:30 +08:00
parent aee1381937
commit 45e1ecb9fa
3 changed files with 6 additions and 3 deletions

View File

@ -7,6 +7,6 @@
<select id="selectMaxResultByResourceId" parameterType="java.lang.String" resultType="io.metersphere.base.domain.ApiDefinitionExecResult"> <select id="selectMaxResultByResourceId" parameterType="java.lang.String" resultType="io.metersphere.base.domain.ApiDefinitionExecResult">
select * from api_definition_exec_result select * from api_definition_exec_result
where resource_id = #{resourceId,jdbcType=VARCHAR} ORDER BY update_time DESC LIMIT 1 where resource_id = #{resourceId,jdbcType=VARCHAR} ORDER BY start_time DESC LIMIT 1
</select> </select>
</mapper> </mapper>

View File

@ -493,6 +493,9 @@
request.enable === undefined ? request.enable = true : request.enable; request.enable === undefined ? request.enable = true : request.enable;
request.active = false; request.active = false;
request.resourceId = getUUID(); request.resourceId = getUUID();
if (!request.url) {
request.url = "";
}
if (referenced === 'REF' || !request.hashTree) { if (referenced === 'REF' || !request.hashTree) {
request.hashTree = []; request.hashTree = [];
} }
@ -604,7 +607,7 @@
this.getEnvironments(); this.getEnvironments();
}, },
allowDrop(draggingNode, dropNode, type) { allowDrop(draggingNode, dropNode, type) {
if (ELEMENTS.get(dropNode.data.type).indexOf(draggingNode.data.type) != -1) { if (dropNode.data.type === draggingNode.data.type || ELEMENTS.get(dropNode.data.type).indexOf(draggingNode.data.type) != -1) {
return true; return true;
} }
return false; return false;

View File

@ -67,7 +67,7 @@
if (Object.prototype.toString.call(this.currentApi.response).match(/\[object (\w+)\]/)[1].toLowerCase() === 'object') { if (Object.prototype.toString.call(this.currentApi.response).match(/\[object (\w+)\]/)[1].toLowerCase() === 'object') {
this.response = this.currentApi.response; this.response = this.currentApi.response;
} else { } else {
this.response = new ResponseFactory(JSON.parse(this.currentApi.response)); this.response = JSON.parse(this.currentApi.response);
} }
} else { } else {
this.response = {headers: [], body: new Body(), statusCode: [], type: "HTTP"}; this.response = {headers: [], body: new Body(), statusCode: [], type: "HTTP"};