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