//选择图片
chooseHeadUrl() {
let that = this
uni.chooseImage({
count: 1, //默认9
sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
success: function(res) {
// console.log(JSON.stringify(res.tempFilePaths));
// that.data.portraitUri = res.tempFilePaths[0]
that.portraitUri = res.tempFilePaths[0]
// console.log(that.portraitUri)
}
})
},
//上传图片OSS
uploadOss(path) {
return new Promise((resolve, reject) => {
let that = this
let reg = RegExp(/mp3/)
let format = '.jpg'
let location = 'image'
if (reg.test(path)) {
format = '.mp3'
location = 'audio'
}
let position = 'tcell/' + location + '/'
getPolicyPrivate(position).then((res) => {
// console.log(res)
// 向后台发请求 拉取OSS相关配置
const cred