From 48beb502bd4e3855d0e157202dc3fa61d35f42db Mon Sep 17 00:00:00 2001 From: ibuler Date: Mon, 28 Jun 2021 19:01:09 +0800 Subject: [PATCH] =?UTF-8?q?fix(settings):=20=E4=BF=AE=E5=A4=8D=E7=B3=BB?= =?UTF-8?q?=E7=BB=9F=E8=AE=BE=E7=BD=AE=E4=B8=AD=E9=82=AE=E4=BB=B6=E6=B2=A1?= =?UTF-8?q?=E6=9C=89=E6=9B=B4=E6=94=B9=E5=B0=B1=E6=97=A0=E6=B3=95=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/settings/Email.vue | 8 +++++++- src/views/settings/Terminal.vue | 12 +++++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/views/settings/Email.vue b/src/views/settings/Email.vue index d5cde7f27..f99857e44 100644 --- a/src/views/settings/Email.vue +++ b/src/views/settings/Email.vue @@ -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 } } diff --git a/src/views/settings/Terminal.vue b/src/views/settings/Terminal.vue index bdba9e5d4..821d72ffb 100644 --- a/src/views/settings/Terminal.vue +++ b/src/views/settings/Terminal.vue @@ -6,6 +6,7 @@ :fields-meta="fieldsMeta" :get-method="getMethod" :has-detail-in-msg="false" + :clean-form-value="cleanFormValue" /> @@ -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 } } - }