feat(接口定义):添加协议处理

This commit is contained in:
fit2-zhao 2020-11-23 19:25:28 +08:00
parent 064735b2a4
commit 4bae9662de
4 changed files with 12 additions and 6 deletions

View File

@ -44,12 +44,12 @@
<!-- 快捷调试 -->
<div v-else-if="item.type=== 'debug'">
<ms-debug-http-page @saveAs="editApi"/>
<ms-debug-http-page :currentProtocol="currentProtocol" @saveAs="editApi"/>
</div>
<!-- 测试-->
<div v-else-if="item.type=== 'test'">
<ms-run-test-http-page :api-data="runTestData" @saveAsApi="editApi" :currentProject="currentProject"/>
<ms-run-test-http-page :currentProtocol="currentProtocol" :api-data="runTestData" @saveAsApi="editApi" :currentProject="currentProject"/>
</div>
</el-tab-pane>

View File

@ -54,6 +54,9 @@
export default {
name: "ApiConfig",
components: {MsRequestResultTail, MsResponseResult, MsApiRequestForm, MsRequestMetric, MsResponseText, MsRun},
props: {
currentProtocol: String,
},
data() {
return {
rules: {
@ -132,6 +135,7 @@
this.debugForm.request = JSON.stringify(this.request);
this.debugForm.userId = getCurrentUser().id;
this.debugForm.status = "Underway";
this.debugForm.protocol = this.currentProtocol;
this.$emit('saveAs', this.debugForm);
}
else {

View File

@ -129,7 +129,7 @@
reportId: "",
}
},
props: {apiData: {}, currentProject: {}},
props: {apiData: {}, currentProject: {}, currentProtocol: String,},
methods: {
handleCommand(e) {
switch (e) {
@ -151,6 +151,7 @@
this.loading = true;
this.api.request.name = this.api.id;
this.api.request.useEnvironment = this.api.environmentId;
this.api.protocol = this.currentProtocol;
this.runData = [];
this.runData.push(this.api.request);
/*触发执行操作*/
@ -278,6 +279,7 @@
},
created() {
this.api = this.apiData;
this.api.protocol = this.currentProtocol;
this.currentRequest = this.api.request;
this.getEnvironments();
this.getResult();

View File

@ -94,9 +94,9 @@ export default {
beforeCreate() {
this.result = this.$get("/isLogin").then(response => {
if (display.default !== undefined) {
display.default.valid(this);
}
// if (display.default !== undefined) {
// display.default.valid(this);
// }
if (!response.data.success) {
if (response.data.message === 'sso') {