From f090f057493c75d9dc40eb0c19b0b3cc51d57a7d Mon Sep 17 00:00:00 2001 From: zhangkai <847704969@qq.com> Date: Thu, 12 Jun 2025 17:30:59 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=A4=B4=E5=83=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packageA/my/person-detail.vue | 50 +++++++++++++++++------------------ 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/packageA/my/person-detail.vue b/packageA/my/person-detail.vue index 8f85066..79a5716 100644 --- a/packageA/my/person-detail.vue +++ b/packageA/my/person-detail.vue @@ -382,31 +382,31 @@ }, upload() { // 示例代码 - // uni.chooseImage({ - // success: (chooseImageRes) => { - // const tempFilePaths = chooseImageRes.tempFilePaths; - // const that = this - // uni.uploadFile({ - // url: 'https://testy.hschool.com.cn//api/common/upload', //仅为示例,非真实的接口地址 - // filePath: tempFilePaths[0], - // name: 'file', - // header: { - // "token": uni.getStorageSync("token") - // }, - // formData: { - // 'user': 'test' - // }, - // success: (res) => { - // let group = JSON.parse(res.data) - // that.upAvatar = group.data.url - // that.avatar = group.data.fullurl - // console.log(group.data) - // console.log(that.avata) - // } - // }); - // } - // }); - this.show5 = true + uni.chooseImage({ + success: (chooseImageRes) => { + const tempFilePaths = chooseImageRes.tempFilePaths; + const that = this + uni.uploadFile({ + url: 'https://naweigetetest2.hschool.com.cn/api/common/upload', //仅为示例,非真实的接口地址 + filePath: tempFilePaths[0], + name: 'file', + header: { + "token": uni.getStorageSync("token") + }, + formData: { + 'user': 'test' + }, + success: (res) => { + let group = JSON.parse(res.data) + that.upAvatar = group.data.url + that.avatar = group.data.fullurl + console.log(group.data) + console.log(that.avata) + } + }); + } + }); + // this.show5 = true }, close() { this.show5 = false