fix(settings): 修复系统设置中邮件没有更改就无法更新的问题

This commit is contained in:
ibuler
2021-06-28 19:01:09 +08:00
committed by 老广
parent 383a799c6a
commit 48beb502bd
2 changed files with 18 additions and 2 deletions

View File

@@ -94,11 +94,17 @@ export default {
getMethod() {
return 'put'
},
// 不清理的话编辑secret在删除提交会报错
cleanFormValue(data) {
if (!data['EMAIL_HOST_PASSWORD']) {
delete data['EMAIL_HOST_PASSWORD']
}
Object.keys(data).forEach(
function(key) {
if (data[key] === null) {
delete data[key]
}
}
)
return data
}
}

View File

@@ -6,6 +6,7 @@
:fields-meta="fieldsMeta"
:get-method="getMethod"
:has-detail-in-msg="false"
:clean-form-value="cleanFormValue"
/>
</IBox>
</template>
@@ -56,9 +57,18 @@ export default {
methods: {
getMethod() {
return 'put'
},
cleanFormValue(data) {
Object.keys(data).forEach(
function(key) {
if (data[key] === null) {
delete data[key]
}
}
)
return data
}
}
}
</script>