diff --git a/src/components/Upload/Image.vue b/src/components/Upload/Image.vue index 16f46ff..a135d74 100644 --- a/src/components/Upload/Image.vue +++ b/src/components/Upload/Image.vue @@ -135,7 +135,7 @@ const actionFile=async (fileChild:any)=>{ const res =await upload(formData) console.log(res) emit('update:imageUrl',res.fileUrl); - emit('changeFileName',res.fileName) + emit('changeFileName',res.originalName) // 调用 el-form 内部的校验方法(可自动校验) formItemContext?.prop && formContext?.validateField([formItemContext.prop as string]); } catch (error) { diff --git a/src/components/Upload/Images.vue b/src/components/Upload/Images.vue index 6c50b40..1d5a9af 100644 --- a/src/components/Upload/Images.vue +++ b/src/components/Upload/Images.vue @@ -118,17 +118,17 @@ const handleHttpUpload = async (options: UploadRequestOptions) => { if (editIndex !== '') { list.splice(editIndex, 1, { url: res.fileUrl, - name: res.fileName, + name: res.originalName, filePath: res.fileUrl, - fileName: res.fileName + fileName: res.originalName }) editIndex = '' } else { list.push({ url: res.fileUrl, - name: res.fileName, + name: res.originalName, filePath: res.fileUrl, - fileName: res.fileName + fileName: res.originalName }) } emit('upload', list,props.zIndex) diff --git a/src/components/Upload/file.vue b/src/components/Upload/file.vue index 163d056..70260ca 100644 --- a/src/components/Upload/file.vue +++ b/src/components/Upload/file.vue @@ -120,13 +120,13 @@ const handleHttpUpload = async (options: UploadRequestOptions) => { let list=JSON.parse(JSON.stringify(props.fileList)) list.push({ url: res.fileUrl, - name: res.fileName, + name: res.originalName, filePath: res.fileUrl, - fileName: res.fileName, + fileName: res.originalName, }) emit('upload', list,props.zIndex) }else{ - emit("upload", res.fileUrl,res.fileName,props.zIndex); + emit("upload", res.fileUrl,res.originalName,props.zIndex); } } catch (error) { ElNotification({