Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
cbcb464f55
|
@ -336,7 +336,11 @@
|
|||
} else {
|
||||
let condition = {};
|
||||
let url = "/api/definition/list/all";
|
||||
condition.filters = ["Prepare", "Underway", "Completed"];
|
||||
condition.filters = new Map(
|
||||
[
|
||||
["status", ["Prepare", "Underway", "Completed"]],
|
||||
]
|
||||
);
|
||||
condition.projectId = getCurrentProjectID();
|
||||
this.$post(url, condition, response => {
|
||||
obj.data = response.data;
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
<el-form-item :label="$t('api_report.request')" prop="url">
|
||||
<el-input :placeholder="$t('api_test.definition.request.path_all_info')" v-model="debugForm.url"
|
||||
class="ms-http-input" size="small" :disabled="testCase!=undefined">
|
||||
class="ms-http-input" size="small" :disabled="testCase!=undefined" @blur="urlChange">
|
||||
<el-select v-model="debugForm.method" slot="prepend" style="width: 100px" size="small">
|
||||
<el-option v-for="item in reqOptions" :key="item.id" :label="item.label" :value="item.id"/>
|
||||
</el-select>
|
||||
|
@ -55,6 +55,7 @@
|
|||
import {REQ_METHOD} from "../../model/JsonData";
|
||||
import MsRequestResultTail from "../response/RequestResultTail";
|
||||
import MsJmxStep from "../step/JmxStep";
|
||||
import {KeyValue} from "../../model/ApiTestModel";
|
||||
|
||||
export default {
|
||||
name: "ApiConfig",
|
||||
|
@ -167,7 +168,35 @@
|
|||
return false;
|
||||
}
|
||||
})
|
||||
},
|
||||
urlChange() {
|
||||
if (!this.debugForm.url || this.debugForm.url.indexOf('?') === -1) return;
|
||||
let url = this.getURL(this.addProtocol(this.debugForm.url));
|
||||
if (url) {
|
||||
this.debugForm.url = decodeURIComponent(this.debugForm.url.substr(0, this.debugForm.url.indexOf("?")));
|
||||
}
|
||||
},
|
||||
addProtocol(url) {
|
||||
if (url) {
|
||||
if (!url.toLowerCase().startsWith("https") && !url.toLowerCase().startsWith("http")) {
|
||||
return "https://" + url;
|
||||
}
|
||||
}
|
||||
return url;
|
||||
},
|
||||
getURL(urlStr) {
|
||||
try {
|
||||
let url = new URL(urlStr);
|
||||
url.searchParams.forEach((value, key) => {
|
||||
if (key && value) {
|
||||
this.request.arguments.splice(0, 0, new KeyValue({name: key, required: false, value: value}));
|
||||
}
|
||||
});
|
||||
return url;
|
||||
} catch (e) {
|
||||
this.$error(this.$t('api_test.request.url_invalid'), 2000);
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
<ms-node-tree
|
||||
v-loading="result.loading"
|
||||
:tree-nodes="data"
|
||||
allLabel="默认模块"
|
||||
@add="add"
|
||||
:type="'edit'"
|
||||
@edit="edit"
|
||||
|
@ -97,6 +98,10 @@
|
|||
this.$warning("请选择一个模块");
|
||||
return;
|
||||
}
|
||||
if (this.currentModule.id === "root") {
|
||||
this.$warning("不能选默认模块,请重新选择一个模块");
|
||||
return;
|
||||
}
|
||||
this.loading = true;
|
||||
let arr = Array.from(this.selectIds);
|
||||
let obj = {testIds: arr, projectId: getCurrentProjectID(), modulePath: this.getPath(this.currentModule.id), moduleId: this.currentModule.id};
|
||||
|
|
Loading…
Reference in New Issue