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,13 +196,15 @@ export default {
let url = null;
if(this.scenario.environment && this.scenario.environment.config.httpConfig
&& 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) {
if (this.scenario.environment.config.httpConfig.conditions[i]) {
let item = this.scenario.environment.config.httpConfig.conditions[i];
if(item.type ==='NONE'){
if (item.type === 'NONE') {
url = item.protocol + '://' + item.socket + (this.request.path ? this.request.path : '');
}
}
}
}
if(url === null) {
url = (this.scenario.environment && this.scenario.environment.config.httpConfig.socket) ?
this.scenario.environment.config.httpConfig.protocol + '://' + this.scenario.environment.config.httpConfig.socket + (this.request.path ? this.request.path : '')