From 379bff350d23061e3dc8b580f758c647a538938d Mon Sep 17 00:00:00 2001 From: da da Date: Sat, 6 May 2023 13:01:58 +0700 Subject: [PATCH] =?UTF-8?q?fix=20=E6=8F=90=E7=8E=B0=E7=95=8C=E9=9D=A2?= =?UTF-8?q?=E3=80=81=E4=B8=8A=E4=BC=A0=E7=95=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.js | 2 +- pages-userInfo/withdraw/withdraw.vue | 879 ++++++++++++++------------- pages/index/upload/upload.vue | 20 +- 3 files changed, 468 insertions(+), 433 deletions(-) diff --git a/main.js b/main.js index 60233a2..b650879 100644 --- a/main.js +++ b/main.js @@ -10,7 +10,7 @@ const baseURL = 'https://service.bnyer.cn' Vue.prototype.$baseURL = baseURL; -Vue.prototype.$uploadURL = "/file/upload"; // ”/file/uploadBatch“ /file/upload +Vue.prototype.$uploadURL = "/file/uploadBatch"; // ”/file/uploadBatch“ /file/upload Vue.prototype.$uploadType = "file"; // files file Vue.prototype.$noMultipleClicks = common.noMultipleClicks; diff --git a/pages-userInfo/withdraw/withdraw.vue b/pages-userInfo/withdraw/withdraw.vue index 4437ced..471dc79 100644 --- a/pages-userInfo/withdraw/withdraw.vue +++ b/pages-userInfo/withdraw/withdraw.vue @@ -1,425 +1,456 @@ - - - - - diff --git a/pages/index/upload/upload.vue b/pages/index/upload/upload.vue index b6c5ee1..7305bc8 100644 --- a/pages/index/upload/upload.vue +++ b/pages/index/upload/upload.vue @@ -205,11 +205,13 @@ }, //選擇文件监听事件 selectHandler(e){ + console.log(e,1111) if (!e.tempFiles) { return; } let that = this; that.fileList = [...that.fileList, ...e.tempFilePaths]; + console.log(that.fileList,333) //检查是否可上传文件 if(that.uploadedNum >= 50){ uni.showModal({ @@ -251,17 +253,19 @@ title: "上传中" }); const tempFilePaths = e; + console.log(tempFilePaths,111) for (var i = 0; i < tempFilePaths.length; i++) { //const tempFile = e.tempFiles[i]; const [error, res] = await uni.uploadFile({ url: `${that.$baseURL}${that.$uploadURL}`, - name: `${that.$uploadType}`, - // url: 'http://pc2zer.natappfree.cc/file/uploadBatch', - // name: 'files', + filePath: tempFilePaths[i], + name: `files`, + formData: { + fileType:that.typeCurrent + 1 + }, header:{ - "Content-Type": "multipart/form-data" + "Content-Type": "multipart/form-data", }, - filePath: tempFilePaths[i], // success:(uploadFileRes) => { // // uni.hideLoading(); // const back = JSON.parse(uploadFileRes.data); @@ -279,9 +283,9 @@ // uni.hideLoading(); // } }); - const back = JSON.parse(res.data); - if (back.code == 200) { - that.imgList.push(back.data); + const {data,code} = JSON.parse(res.data); + if (code == 200) { + that.imgList.push(data[0]) } }