Compare commits
2 Commits
3dbe84e78e
...
985edee594
Author | SHA1 | Date | |
---|---|---|---|
985edee594 | |||
f090f05749 |
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user