fix(接口测试): 环境中没有填写环境域名提示
This commit is contained in:
parent
ff2fcd620b
commit
105115de01
|
@ -29,7 +29,7 @@
|
|||
<span class="environment-name">{{ request.environment ? request.environment.name + ': ' : '' }}</span>
|
||||
<span class="environment-url">{{ displayUrl }}</span>
|
||||
<span v-if="!displayUrl"
|
||||
class="environment-url-tip">{{ $t('api_test.request.please_configure_environment_in_scenario') }}</span>
|
||||
class="environment-url-tip">{{ $t('api_test.request.please_configure_socket_in_environment') }}</span>
|
||||
</el-tag>
|
||||
</el-form-item>
|
||||
|
||||
|
|
|
@ -246,7 +246,7 @@ export class Scenario extends BaseConfig {
|
|||
isValid() {
|
||||
if (this.enable) {
|
||||
for (let i = 0; i < this.requests.length; i++) {
|
||||
let validator = this.requests[i].isValid(this.environmentId);
|
||||
let validator = this.requests[i].isValid(this.environmentId, this.environment);
|
||||
if (!validator.isValid) {
|
||||
return validator;
|
||||
}
|
||||
|
@ -357,7 +357,7 @@ export class HttpRequest extends Request {
|
|||
return options;
|
||||
}
|
||||
|
||||
isValid(environmentId) {
|
||||
isValid(environmentId, environment) {
|
||||
if (this.enable) {
|
||||
if (this.useEnvironment) {
|
||||
if (!environmentId) {
|
||||
|
@ -366,6 +366,12 @@ export class HttpRequest extends Request {
|
|||
info: 'api_test.request.please_configure_environment_in_scenario'
|
||||
}
|
||||
}
|
||||
if (!environment.config.httpConfig.socket) {
|
||||
return {
|
||||
isValid: false,
|
||||
info: 'api_test.request.please_configure_socket_in_environment'
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (!this.url) {
|
||||
return {
|
||||
|
|
Loading…
Reference in New Issue