From dcb96daafb67cc5326d76be5c94d71484e9dfe58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=BC=BA?= <1206709430@qq.com> Date: Mon, 16 May 2022 09:38:03 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=EF=BC=9A=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E5=8D=95=E5=BC=A0=E5=9B=BE=E7=89=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/application/dispatch.py | 5 ++++- web/src/views/system/config/components/formContent.vue | 6 +++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/backend/application/dispatch.py b/backend/application/dispatch.py index 213804e..25fbdb9 100644 --- a/backend/application/dispatch.py +++ b/backend/application/dispatch.py @@ -36,7 +36,10 @@ def _get_all_system_config(): system_config_obj = SystemConfig.objects.filter(status=True, parent_id__isnull=False).values( 'parent__key', 'key', 'value', 'form_item_type').order_by('sort') for system_config in system_config_obj: - data[f"{system_config.get('parent__key')}.{system_config.get('key')}"] = system_config.get('value') or '' + value = system_config.get('value') or '' + if value and system_config.get('form_item_type') == 7: + value = value[0].get('url') + data[f"{system_config.get('parent__key')}.{system_config.get('key')}"] = value return data diff --git a/web/src/views/system/config/components/formContent.vue b/web/src/views/system/config/components/formContent.vue index 5dd4325..970cfdb 100644 --- a/web/src/views/system/config/components/formContent.vue +++ b/web/src/views/system/config/components/formContent.vue @@ -7,7 +7,7 @@ @@ -118,7 +118,7 @@ :on-error="handleError" :on-exceed="handleExceed" :before-remove="(file, fileList)=>{beforeRemove(file, fileList, item.key)}" - :limit="item.form_item_type_label==='img'?1:5" + :limit="5" :ref="'fileUpload_'+item.key" :data-keyname="item.key" :file-list="item.value" @@ -416,7 +416,7 @@ export default { this.$message.error('只允许上传图片') } else { const uploadImgKey = that.form[imgKey] - if (!uploadImgKey) { + if (!uploadImgKey || uploadImgKey === '') { that.form[imgKey] = [] } // console.log(len)