From 4d7a62d33760af637c4dbcd448d9635cb5d95ca3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E4=BC=9F?= <943146732@qq.com> Date: Wed, 13 Mar 2024 11:12:07 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=AD=97=E7=AC=A6=E5=A4=84?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/store/Setting.vue | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/views/store/Setting.vue b/src/views/store/Setting.vue index ae7dff0..d210167 100644 --- a/src/views/store/Setting.vue +++ b/src/views/store/Setting.vue @@ -139,7 +139,13 @@ export default { // 提交到后端api onFormSubmit (values) { this.isLoading = true - Api.update({ form: { ...values, new_product_img_id: values.new_product_img_id.join(','), big_brand_img_id: values.big_brand_img_id.join(','), new_people_order_img_id: values.new_people_order_img_id.join(',') } }) + const params = { + new_product_img_id: (values.new_product_img_id && values.new_product_img_id.join(',')) || '', + big_brand_img_id: (values.big_brand_img_id && values.big_brand_img_id.join(',')) || '', + new_people_order_img_id: (values.new_people_order_img_id && values.new_people_order_img_id.join(',')) || '' + } + + Api.update({ form: { ...values, ...params } }) .then(result => this.$message.success(result.message, 1.5)) .finally(() => this.isLoading = false) }