From d07542d480856f7e66b19a27ba6ebc0c6d361acb Mon Sep 17 00:00:00 2001 From: lijianzhong Date: Mon, 29 Jan 2024 09:22:02 +0800 Subject: [PATCH] =?UTF-8?q?feat=EF=BC=9A=E6=96=87=E4=BB=B6=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E4=B8=8A=E4=BC=A0=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/CustomUpload/index.vue | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/components/CustomUpload/index.vue b/src/components/CustomUpload/index.vue index ea2e611..96ac924 100644 --- a/src/components/CustomUpload/index.vue +++ b/src/components/CustomUpload/index.vue @@ -204,7 +204,7 @@ const handleUpload = (res) => { clearInterval(timmer.value); timmer.value = null; if (res.data) { - res.data.url = import.meta.env.VITE_UPLOAD_IMG_URL + res.data.filepath; + res.data.url = res.data.filepath; res.data.fileType = getFileType(res.data.url); fileList.value.push(res.data); emits("onUpdate", fileList.value); @@ -222,9 +222,9 @@ const handleRemove = (val: any) => { arr.forEach((item: any, index: any) => { if (item == val) { arr.splice(index, 1); - emits("onUpdate", arr); } }); + emits("onUpdate", arr); } }); }; @@ -290,10 +290,9 @@ const getFileType = (fileName) => { const setFiles = () => { fileList.value = []; props.listPic.forEach((item: any) => { - item.url = import.meta.env.VITE_UPLOAD_IMG_URL + item.filepath; + item.url = item.filepath; item.fileType = getFileType(item.url); fileList.value.push(item); - emits("onUpdate", fileList.value); }); };