- 当前 Bug 的表现(可附上截图)
- 预期表现
获取图片本地路径
- 复现路径
获取图片本地路径
- 提供一个最简复现 Demo
获取图片本地路径
choice1: function(e) {
var self = this;
wx.chooseImage({
count: 1,
sourceType: [‘album’, ‘camera’],
sizeType: [‘original’, ‘compressed’],
success: function(res) {
var re=res;
wx.getImageInfo({
src: res.tempFilePaths[0],
success(res) {
console.log(res.path)
wx.request({
data: {
// url: self.utf16to8(res.path)
url: self.utf16to8(‘https://ss2.baidu.com/-vo3dSag_xI4khGko9WTAnF6hhy/image/h%3D300/sign=092fd68637292df588c3aa158c305ce2/9345d688d43f879439035b87df1b0ef41ad53a9e.jpg’)
},
header: {
‘content-type’: ‘application/x-www-form-urlencoded’
},
method: ‘post’,
success(re) {
console.log(re)
}
})
}
})
},
})
},