# saveImageToPhotosAlbum ^6.8

保存图片到相册

# 请求参数

Prop Type Comment
src String 图片文件路径(相对路径)
base64 String 图片文件base64(不含前缀)

# 参数代码示例

    let params = {
        src: 'localImages/weex_1598499691_0.jpg'
    }
1
2
3

# 接口调用示例

      let params = { src: this.src}  
      this.$bridge
        .saveImageToPhotosAlbum(params)
        .then(res => {    
          this.$alert(res)
        })
        .catch(err => {
          this.$toast(err)
        })

1
2
3
4
5
6
7
8
9
10

# 返回参数

  • 成功时返回
Prop Type Value
msg String -
code Number 0
  • 失败时返回
Prop Type Value Comment
code Number -7 文件不存在
msg String -

# 返回示例


{
    "msg": "success",
    "code": 0
}

1
2
3
4
5
6
Last Updated: 5/7/2024, 9:08:45 AM