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) }