wx.createCameraContext()调用takePhoto返回的res.tempImagePath怎么转成base64的图片???
这个返回的是照片文件的临时路径,暂不支持此功能
wx.createCameraContext().takePhoto({
quality: ‘high’,
success: (res) => {
let tempImagePath = res.tempImagePath
wx.getFileSystemManager().readFile({
filePath: tempImagePath,
encoding: ‘base64’,
let avatarBase64 = res.data
console.log(avatarBase64)
wx.hideLoading()
}
})