refactor: 优化样式

This commit is contained in:
wxg0103 2024-10-25 18:06:18 +08:00 committed by wxg0103
parent cfbec5c44c
commit e6c271dd81

View File

@ -21,7 +21,12 @@ template
:prop="key"
:rules="getValidationRules(key)"
>
<el-input v-model="currentPlatform.config[key]" :default-value="''"></el-input>
<el-input
v-model="currentPlatform.config[key]"
:type="isPasswordField(key) ? 'password' : 'text'"
:show-password="isPasswordField(key)"
>
</el-input>
</el-form-item>
</el-form>
<template #footer>
@ -144,6 +149,10 @@ function validateConnection() {
})
}
const passwordFields = new Set(['app_secret', 'client_secret', 'secret'])
const isPasswordField = (key: any) => passwordFields.has(key)
function saveConfig() {
platformApi.updateConfig(currentPlatform, loading).then((res: any) => {
MsgSuccess('保存成功')