From 9b924715e72877bfb6680b40293f4e955f8f49c6 Mon Sep 17 00:00:00 2001 From: wyy <3234929097@qq.com> Date: Mon, 27 Mar 2023 17:49:12 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=B8=8A=E4=BC=A0=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E6=8E=A7=E5=88=B6=E5=8F=B0=E6=8A=A5=E9=94=99=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98&=E4=BF=AE=E6=94=B9=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/index.html | 2 +- src/components/mul-pic-upload/index.vue | 10 ++++++++-- src/components/pic-upload/index.vue | 2 +- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/public/index.html b/public/index.html index fe4951b..87bfe8c 100644 --- a/public/index.html +++ b/public/index.html @@ -7,7 +7,7 @@ <%= htmlWebpackPlugin.options.title %> diff --git a/src/components/mul-pic-upload/index.vue b/src/components/mul-pic-upload/index.vue index 4e0f127..663c0f1 100644 --- a/src/components/mul-pic-upload/index.vue +++ b/src/components/mul-pic-upload/index.vue @@ -49,7 +49,10 @@ // 图片上传 handleUploadSuccess (response, file, fileList) { let pics = fileList.map(file => { - return file.response + if (typeof file.response === 'string') { + return file.response + } + return file.response.data }).join(',') this.$emit('input', pics) }, @@ -67,7 +70,10 @@ }, handleRemove (file, fileList) { let pics = fileList.map(file => { - return file.response + if (typeof file.response === 'string') { + return file.response + } + return file.response.data }).join(',') this.$emit('input', pics) }, diff --git a/src/components/pic-upload/index.vue b/src/components/pic-upload/index.vue index 93259df..46deb84 100644 --- a/src/components/pic-upload/index.vue +++ b/src/components/pic-upload/index.vue @@ -29,7 +29,7 @@ methods: { // 图片上传 handleUploadSuccess (response, file, fileList) { - this.$emit('input', file.response) + this.$emit('input', file.response.data) }, // 限制图片上传大小 beforeAvatarUpload (file) {