refactor(接口测试): 认证配置选项增加清空

--story=1013289 --user=王孝刚
【Bug转需求】【接口测试】github#26983,接口测试,认证配置,如果勾选了其中任何一个认证, 就无法删除了,必须得勾选一个
https://www.tapd.cn/55049933/s/1424531
This commit is contained in:
wxg0103 2023-10-10 17:40:03 +08:00 committed by Craftsman
parent 2358145a3c
commit 09e7e0b247
3 changed files with 13 additions and 4 deletions

View File

@ -10,6 +10,7 @@
:disabled="isReadOnly"
:placeholder="$t('api_test.definition.request.verification_method')"
filterable
clearable
size="small">
<el-option v-for="item in options" :key="item.name" :label="item.name" :value="item.name"> </el-option>
</el-select>
@ -120,7 +121,11 @@ export default {
this.request.authManager = this.authConfig;
} else {
let authManager = createComponent('AuthManager');
authManager.verification = 'No Auth';
if (!this.authConfig.verification) {
authManager.verification = null;
} else {
authManager.verification = 'No Auth';
}
if (!this.request.hashTree) {
this.request.hashTree = [];
}

View File

@ -368,7 +368,7 @@ export default {
});
},
showAuthSubscript() {
return this.request.authManager && this.request.authManager.verification !== 'No Auth';
return this.request.authManager && this.request.authManager.verification !== 'No Auth' && this.request.authManager.verification;
},
showSubscript() {
return (

View File

@ -5,7 +5,7 @@
<el-form :model="authConfig" :rules="rule" ref="authConfig" label-position="right">
<el-form-item :label="$t('api_test.definition.request.verification_method')" prop="verification">
<el-select v-model="authConfig.verification" @change="change" :disabled="isReadOnly"
<el-select v-model="authConfig.verification" @change="change" :disabled="isReadOnly" clearable
:placeholder="$t('api_test.definition.request.verification_method')" filterable size="small">
<el-option
v-for="item in options"
@ -101,7 +101,11 @@ export default {
this.request.authManager = this.authConfig;
} else {
let authManager = {};
authManager.verification = "No Auth";
if (!this.authConfig.verification) {
authManager.verification = null;
} else {
authManager.verification = "No Auth";
}
if (this.request.hashTree == undefined) {
this.request.hashTree = [];
}