修改头像

This commit is contained in:
张凯 2025-06-12 17:30:59 +08:00
parent 1602e1da54
commit f090f05749

View File

@ -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