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