fix(旧版本接口测试): 兼容新版本定义的环境

This commit is contained in:
fit2-zhao 2021-05-06 18:48:09 +08:00 committed by fit2-zhao
parent 3936d17151
commit 1b9328cc15
1 changed files with 6 additions and 4 deletions

View File

@ -196,10 +196,12 @@ export default {
let url = null; let url = null;
if(this.scenario.environment && this.scenario.environment.config.httpConfig if(this.scenario.environment && this.scenario.environment.config.httpConfig
&& this.scenario.environment.config.httpConfig.conditions && this.scenario.environment.config.httpConfig.conditions.length > 0){ && this.scenario.environment.config.httpConfig.conditions && this.scenario.environment.config.httpConfig.conditions.length > 0){
for(let i in this.scenario.environment.config.httpConfig.conditions){ for(let i in this.scenario.environment.config.httpConfig.conditions) {
let item = this.scenario.environment.config.httpConfig.conditions[i]; if (this.scenario.environment.config.httpConfig.conditions[i]) {
if(item.type ==='NONE'){ let item = this.scenario.environment.config.httpConfig.conditions[i];
url = item.protocol + '://' + item.socket + (this.request.path ? this.request.path : ''); if (item.type === 'NONE') {
url = item.protocol + '://' + item.socket + (this.request.path ? this.request.path : '');
}
} }
} }
} }