fix(接口测试):引用环境url显示问题
This commit is contained in:
parent
dc41ddc683
commit
5ef0f5a629
|
@ -9,7 +9,7 @@
|
|||
<el-select :disabled="isReadOnly" v-model="scenario.environmentId" class="environment-select"
|
||||
@change="environmentChange" clearable>
|
||||
<el-option v-for="(environment, index) in environments" :key="index"
|
||||
:label="environment.name + ': ' + environment.protocol + '://' + environment.socket"
|
||||
:label="environment.name + (environment.config.httpConfig.socket ? (': ' + environment.config.httpConfig.protocol + '://' + environment.config.httpConfig.socket) : '')"
|
||||
:value="environment.id"/>
|
||||
<el-button class="environment-button" size="mini" type="primary" @click="openEnvironmentConfig">
|
||||
{{ $t('api_test.environment.environment_config') }}
|
||||
|
|
|
@ -148,7 +148,7 @@ export default {
|
|||
if (!this.request.path) return;
|
||||
let url = this.getURL(this.displayUrl);
|
||||
let urlStr = url.origin + url.pathname;
|
||||
let envUrl = this.request.environment.protocol + '://' + this.request.environment.socket;
|
||||
let envUrl = this.request.environment.config.httpConfig.protocol + '://' + this.request.environment.config.httpConfig.socket;
|
||||
this.request.path = decodeURIComponent(urlStr.substring(envUrl.length, urlStr.length));
|
||||
},
|
||||
getURL(urlStr) {
|
||||
|
@ -194,7 +194,8 @@ export default {
|
|||
return this.request.method !== "GET";
|
||||
},
|
||||
displayUrl() {
|
||||
return this.request.environment ? this.request.environment.protocol + '://' + this.request.environment.socket + (this.request.path ? this.request.path : '') : '';
|
||||
return this.request.environment.config.httpConfig.socket ? this.request.environment.config.httpConfig.protocol + '://'
|
||||
+ this.request.environment.config.httpConfig.socket + (this.request.path ? this.request.path : '') : '';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue