fix(接口定义): 修复自定义请求转存为接口后,没有选环境但case可执行的缺陷

--bug=1018314 --user=王孝刚 【接口测试】接口场景自定义请求转接口后自带CASE,但运行环境显示为NULL,且可以直接运行
https://www.tapd.cn/55049933/s/1265809
This commit is contained in:
wxg0103 2022-10-18 14:10:34 +08:00 committed by wxg0103
parent 97725c4495
commit fb42e27062
2 changed files with 3 additions and 3 deletions

View File

@ -483,7 +483,7 @@ export default {
}, },
singleRun(data) { singleRun(data) {
let methods = ["SQL", "DUBBO", "dubbo://", "TCP"]; let methods = ["SQL", "DUBBO", "dubbo://", "TCP"];
if (data.apiMethod && methods.indexOf(data.apiMethod) === -1 && this.environment === undefined) { if (data.apiMethod && methods.indexOf(data.apiMethod) === -1 && (!this.environment || this.environment === undefined)) {
this.$warning(this.$t('api_test.environment.select_environment')); this.$warning(this.$t('api_test.environment.select_environment'));
return; return;
} }

View File

@ -252,7 +252,7 @@ export default {
} }
this.visible = true; this.visible = true;
this.api = api; this.api = api;
if(this.currentApi && api) { if (this.currentApi && api) {
Object.assign(this.currentApi, api); Object.assign(this.currentApi, api);
} }
this.addCase(); this.addCase();
@ -575,7 +575,7 @@ export default {
}, },
singleRun(row) { singleRun(row) {
let methods = ["SQL", "DUBBO", "dubbo://", "TCP"]; let methods = ["SQL", "DUBBO", "dubbo://", "TCP"];
if (row.apiMethod && methods.indexOf(row.apiMethod) === -1 && this.environment === undefined) { if (row.apiMethod && methods.indexOf(row.apiMethod) === -1 && (!this.environment || this.environment === undefined)) {
this.$warning(this.$t('api_test.environment.select_environment')); this.$warning(this.$t('api_test.environment.select_environment'));
return; return;
} }