image.png
wx.saveImageToPhotosAlbum({
filePath: path,
success: (res) => {
wx.showToast({
title: '保存成功,请到相册查看',
icon: 'none'
})
},
fail: (res) => {
wx.getSetting({
success: res => {
let authSetting = res.authSetting
if (!authSetting['scope.writePhotosAlbum']) {
wx.showToast({
title: '授权失败',
icon: 'error'
})
} else {
wx.showToast({
title: '保存失败',
icon: 'error'
})
}
}
})
}
})