fix(接口自动化): 修复新功能导致执行问题

This commit is contained in:
fit2-zhao 2021-02-25 18:44:33 +08:00
parent 9b2b7e7f63
commit 6b47ed7470
2 changed files with 32 additions and 22 deletions

View File

@ -61,29 +61,29 @@
</template>
<script>
import MsSqlBasisParameters from "../../../definition/components/request/database/BasisParameters";
import MsTcpBasisParameters from "../../../definition/components/request/tcp/TcpBasisParameters";
import MsDubboBasisParameters from "../../../definition/components/request/dubbo/BasisParameters";
import MsApiRequestForm from "../../../definition/components/request/http/ApiHttpRequestForm";
import MsRequestResultTail from "../../../definition/components/response/RequestResultTail";
import MsRun from "../../../definition/components/Run";
import {getUUID} from "@/common/js/utils";
import ApiBaseComponent from "../common/ApiBaseComponent";
import ApiResponseComponent from "./ApiResponseComponent";
import CustomizeReqInfo from "@/business/components/api/automation/scenario/common/CustomizeReqInfo";
import {getProject} from "@/business/components/api/automation/scenario/event";
import MsSqlBasisParameters from "../../../definition/components/request/database/BasisParameters";
import MsTcpBasisParameters from "../../../definition/components/request/tcp/TcpBasisParameters";
import MsDubboBasisParameters from "../../../definition/components/request/dubbo/BasisParameters";
import MsApiRequestForm from "../../../definition/components/request/http/ApiHttpRequestForm";
import MsRequestResultTail from "../../../definition/components/response/RequestResultTail";
import MsRun from "../../../definition/components/Run";
import {getUUID,getCurrentProjectID} from "@/common/js/utils";
import ApiBaseComponent from "../common/ApiBaseComponent";
import ApiResponseComponent from "./ApiResponseComponent";
import CustomizeReqInfo from "@/business/components/api/automation/scenario/common/CustomizeReqInfo";
import {getProject} from "@/business/components/api/automation/scenario/event";
export default {
name: "MsApiComponent",
props: {
request: {},
currentScenario: {},
node: {},
draggable: {
type: Boolean,
default: false,
},
currentEnvironmentId: String,
export default {
name: "MsApiComponent",
props: {
request: {},
currentScenario: {},
node: {},
draggable: {
type: Boolean,
default: false,
},
currentEnvironmentId: String,
},
components: {
CustomizeReqInfo,
@ -103,6 +103,7 @@ export default {
if (!this.request.requestResult) {
this.request.requestResult = {responseResult: {}};
}
this.request.projectId = getCurrentProjectID();
//
this.getApiInfo();
this.getWsProjects();
@ -215,6 +216,9 @@ export default {
this.request.requestResult = requestResult;
this.request.id = response.data.id;
this.request.disabled = true;
if (!this.request.projectId) {
this.request.projectId = response.data.projectId;
}
this.reload();
this.sort();
} else {

View File

@ -30,6 +30,7 @@
import MsApiRequestForm from "../../../definition/components/request/http/ApiHttpRequestForm";
import ApiBaseComponent from "../common/ApiBaseComponent";
import {getProject} from "@/business/components/api/automation/scenario/event";
import {getCurrentProjectID} from "@/common/js/utils";
export default {
name: "ApiScenarioComponent",
@ -45,6 +46,7 @@
watch: {},
created() {
this.getWsProjects();
this.scenario.projectId = getCurrentProjectID();
getProject.$emit('addProjectEnv', this.scenario.projectId, this.currentEnvironmentId);
if (this.scenario.id && this.scenario.referenced === 'REF' && !this.scenario.loaded) {
this.result = this.$get("/api/automation/getApiScenario/" + this.scenario.id, response => {
@ -58,6 +60,10 @@
}
this.scenario.disabled = true;
this.scenario.name = response.data.name;
if (!this.scenario.projectId) {
this.scenario.projectId = response.data.projectId;
}
this.$emit('refReload');
} else {
this.scenario.referenced = "Deleted";