From f0a6ed39258cd445278f9e726e5b839605e02d57 Mon Sep 17 00:00:00 2001 From: yz3456 <2753272399@qq.com> Date: 星期六, 18 五月 2024 17:00:59 +0800 Subject: [PATCH] 修改了安卓端上传图片无法显示问题 --- ruoyi-ui/src/views/pet/petnote.vue | 31 +++++++++++++++++-------------- 1 files changed, 17 insertions(+), 14 deletions(-) diff --git a/ruoyi-ui/src/views/pet/petnote.vue b/ruoyi-ui/src/views/pet/petnote.vue index f2c326b..b3f80f4 100644 --- a/ruoyi-ui/src/views/pet/petnote.vue +++ b/ruoyi-ui/src/views/pet/petnote.vue @@ -202,7 +202,7 @@ style="margin-left: 10px" size="small" type="success" - + @click="picUpload" >涓婁紶鍒版湇鍔″櫒</el-button> <h4 class="form-header">鍏朵粬闄勪欢 </h4> @@ -299,7 +299,7 @@ // 鏁版嵁鑼冨洿閫夐」 fot:['.bmp','.jpg','.jpeg','.png','.tif','.gif','.pcx','.tga','.exif','.fpx', '.svg','.psd','.cdr','.pcd','.dxf','.ufo','.eps','.ai','.aw','.WMF','.webp','.apng'], - + fileList:[ ], fileList1:[], @@ -418,9 +418,9 @@ this.$delete(this.fileList,i); this.$delete(this.uploadFileList,i); } - + //alert(this.formData.url) - + } }, handleRemoveFile(file) { @@ -428,10 +428,10 @@ { if(this.fileListOther[i].url==file.url) { - + this.$delete(this.fileListOther,i); this.$delete(this.uploadFileList1,i); - + } } }, @@ -521,6 +521,7 @@ // return elem.url.replace(process.env.VUE_APP_BASE_TRUE_API,"") // }).join(",") this.formDat.pid = pid; + // console.log(this.formDat,'formDatformDatformDatformDat') // this.formDat.url = ul+","+uls this.$refs["elForm"].validate(valid => { if (valid) { @@ -539,7 +540,7 @@ }, handleChange(file, fileList1) { //瀹氫箟涓�涓叏灞�鏁扮粍uploadFileList鏉ュ仛瀛樺偍 - + // this.uploadFileList.push(file.raw); console.log("=========5555=========") console.log(file) @@ -562,7 +563,7 @@ }, fileUpload(){ // var file = params.file; - + var formData = new FormData(); // this.$refs.upload1.submit(); // formData.append('uploadFile', file); @@ -572,18 +573,18 @@ } this.uploadFileList1.forEach((elem)=>{ formData.append("files", elem) - + }) - + let _this = this - + this.uploading = true; uploadPic(formData).then(response => { _this.uploadFileList1 = [] _this.formDat.url = _this.formDat.url+","+response.fileNames _this.$modal.msgSuccess("鏂囦欢涓婁紶鎴愬姛!"); }) - + }, picUpload() { @@ -598,7 +599,7 @@ //console.log(this.uploadFileList) this.uploadFileList.forEach((elem)=>{ formData.append("files", elem) - + }) //alert(90) let _this = this @@ -606,10 +607,12 @@ uploadPic(formData).then(response => { // alert("dds") _this.formDat.url = _this.formDat.url+","+response.fileNames + alert(_this.formDat.url) _this.uploadFileList = [] _this.$modal.msgSuccess("鍥剧墖涓婁紶鎴愬姛"); - + }); + // console.log(this.formDat,'formDatformDatformDatformDat') }, requestUpload(params) { //alert(98) -- Gitblit v1.9.1