wx.saveImageToPhotosAlbum保存失败
发布于 5 年前 作者 taochen 6868 次浏览 来自 问答
  • 当前 Bug 的表现(可附上截图)
wx.getSetting({
     success:(res)=>{
       if (!res.authSetting['scope.writePhotosAlbum']){
         console.log('没有获取授权');
         wx.authorize({
           scope: 'scope.writePhotosAlbum',
           success:(res)=>{
             console.log('获取授权')
             console.log('path = ' + _that.data.tempFilePath)
             wx.saveImageToPhotosAlbum({
               filePath: _that.data.tempFilePath,
               success: (res) => {
                 console.log('保存到相册');
                 console.log(res)
               },
               fail:(res)=>{
                 console.log('保存失败');
                 console.log(res)
               },
               complete:(res)=>{
                 console.log('调用完成')
               }
             })
           }
         })

不知道为什么就没有保存成功

2 回复

你好,麻烦提供相关的代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html),方便定位问题

这是缺少token,你请求的图片需要有token

回到顶部