|
@@ -251,7 +251,7 @@
|
|
|
let that = this
|
|
let that = this
|
|
|
uni.chooseImage({
|
|
uni.chooseImage({
|
|
|
count: 1, //默认9
|
|
count: 1, //默认9
|
|
|
- sizeType: ['original'], //可以指定是原图还是压缩图,默认二者都有
|
|
|
|
|
|
|
+ sizeType: ['compressed'], //可以指定是原图还是压缩图,默认二者都有
|
|
|
sourceType: ['album'], //从相册选择
|
|
sourceType: ['album'], //从相册选择
|
|
|
success: function (res) {
|
|
success: function (res) {
|
|
|
let tempUrl = res.tempFiles[0].path
|
|
let tempUrl = res.tempFiles[0].path
|
|
@@ -269,10 +269,26 @@
|
|
|
console.log('+++++++++++++++++chooseavatar+++++++++++++++++++++++', uploadFileRes.data)
|
|
console.log('+++++++++++++++++chooseavatar+++++++++++++++++++++++', uploadFileRes.data)
|
|
|
that.form.imgUrl = res.data.url.replace(/^http:/, "https:")
|
|
that.form.imgUrl = res.data.url.replace(/^http:/, "https:")
|
|
|
that.form.img = res.data.ossId
|
|
that.form.img = res.data.ossId
|
|
|
- }
|
|
|
|
|
|
|
+ },
|
|
|
|
|
+ fail: (err) => {
|
|
|
|
|
+ console.log(err)
|
|
|
|
|
+ uni.showToast({
|
|
|
|
|
+ icon: 'error',
|
|
|
|
|
+ duration: 2000,
|
|
|
|
|
+ title: err.errMsg
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ },
|
|
|
|
|
+ fail: function(err) {
|
|
|
|
|
+ console.log(err)
|
|
|
|
|
+ uni.showToast({
|
|
|
|
|
+ icon: 'error',
|
|
|
|
|
+ duration: 2000,
|
|
|
|
|
+ title: err.errMsg
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
},
|
|
},
|