微信开放社区
服务商入驻
文档
登录
切换主页

暂无个人介绍

关注私信

正在关注

0

关注者

0

获得过 0 次赞
回答过的问题获得 0 次赞
分享过的文章/案例获得 0 次赞
评论与回复获得 0 次赞
文章 回答 1提问 收藏 关注问题
  • 已经获取相册写权限。但是报错:saveImageToPhotosAlbum:fail permission denied, open ../../pages/images/decorate.jpg 看起来似乎是读取下载文件时获取文件的权限缺失。

    使用wx.saveImageToPhotosAlbum保存到相册失败?

    saveCode(){ uni.showModal({ title: '提示',  content: '是否保存到相册', confirmText: '确定', success: res => { if (res.confirm) { let base64 = this.codePath.replace(/^data:image\/\w+;base64,/, ""); let filepath = wx.env.USER_DATA_PATH + '/test.png'; // 此处在微信开发工具上打印的是http://usr/text.png保存成功 但是在真机上显示wxfile://usr/test.png保存失败 console.log(filepath,'123123'); let FileSystemManager = uni.getFileSystemManager(); FileSystemManager.writeFile({ filePath: filepath, data: base64, encoding: 'base64', success: res2 => { console.log(res2,111111); uni.saveImageToPhotosAlbum({ filePath: filepath, success: res3 => { uni.showModal({ title: '提示', content: '保存成功', confirmText: '确定', showCancel: false }) }, fail: err => { uni.showModal({ title: '提示', content: '保存失败', confirmText: '确定', showCancel: false }) } }) }, fail: err => { uni.showModal({ title: '提示', content: '保存失败', confirmText: '确定', showCancel: false }) } }) } } }) }

    2023-03-21
关闭

选择需要上架的开放服务

  • 模板开发

    针对行业、场景的小程序代开发服务,帮助企业快速搭建小程序

    上架
  • 插件

    提供可被小程序直接使用、丰富小程序能力的功能模块

    上架
  • 小商店服务

    为小商店商家提供更多的能力,帮助商家经营好小商店

    上架
关闭

案例类型

  • 小程序
  • 插件
  • 关于腾讯
  • 运营规范
  • 文档中心
  • 辟谣中心
  • 客服中心
  • Copyright © 2012-2025 Tencent. All Rights Reserved.