From 93b8f8729bff36b3a55365b555f3602b5e10f6f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B5=85=E5=BF=B5?= Date: Sat, 22 Mar 2025 17:32:44 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9B=BE=E7=89=87=E4=B8=8A=E4=BC=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/customer/followup.vue | 13 ++++++++++--- pages/mine/changinfo.vue | 15 +++++++++++---- 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/pages/customer/followup.vue b/pages/customer/followup.vue index ab73918..97152d2 100644 --- a/pages/customer/followup.vue +++ b/pages/customer/followup.vue @@ -435,11 +435,18 @@ url: 'http://219.157.255.213:9007/upload/uploadImage', filePath: imgUrl, name: 'files', - header:{'content-type': 'application/x-www-form-urlencoded','Authorization': 'Bearer ' + uni.getStorageSync('token')}, + // header:{'content-type': 'application/x-www-form-urlencoded','Authorization': 'Bearer ' + uni.getStorageSync('token')}, success: (uploadFileRes) => { const path=JSON.parse(uploadFileRes.data) - that.form[name] = path.data.path - console.log(that.form) + if(path.code==-1){ + uni.showToast({ + title: path.message, + icon: 'none' + }); + }else{ + that.form[name] = path.data.path + console.log(that.form) + } } }); }, diff --git a/pages/mine/changinfo.vue b/pages/mine/changinfo.vue index 099c189..5cde56e 100644 --- a/pages/mine/changinfo.vue +++ b/pages/mine/changinfo.vue @@ -165,12 +165,19 @@ uni.uploadFile({ url: 'http://219.157.255.213:9007/upload/uploadImage', filePath: imgUrl, - name: 'image', - header:{'content-type': 'application/x-www-form-urlencoded','Authorization': 'Bearer ' + uni.getStorageSync('token')}, + name: 'files', + // header:{'content-type': 'application/x-www-form-urlencoded','Authorization': 'Bearer ' + uni.getStorageSync('token')}, success: (uploadFileRes) => { const path=JSON.parse(uploadFileRes.data) - that.userinfo.avatar = path.data.image_url - console.log(that.carinfo) + if(path.code==-1){ + uni.showToast({ + title: path.message, + icon: 'none' + }); + }else{ + that.userinfo.avatar = path.data.path + console.log(that.form) + } } }); },