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