wx.cloud.deleteFile

从云存储空间删除文件,一次最多 50 个

请求参数

字段 说明 数据类型 默认值 必填
fileList 云文件 ID 字符串数组 String[] - Y
config 配置 Object - N
success 成功回调
fail 失败回调
complete 结束回调

config 对象定义

字段 说明 数据类型
env 使用的环境 ID,填写后忽略 init 指定的环境 String

success 返回参数

字段 说明 数据类型
fileList 删除结果列表,列表中的每一个对象的定义见下表 Object[]

fileList 列表中的对象说明

字段 说明 数据类型
fileID 云文件 ID String
status 状态码,0 为成功 Number
errMsg 成功为 ok,失败为失败原因 String

fail 返回参数

字段 说明 数据类型
errCode 错误码 Number
errMsg 错误信息,格式 apiName:fail msg String

使用示例

Callback 风格

wx.cloud.deleteFile({
  fileList: ['a7xzcb'],
  success: res => {
    // handle success
    console.log(res.fileList)
  },
  fail: err => {
    // handle error
  }
})

Promise 风格

wx.cloud.deleteFile({
  fileList: ['a7xzcb']
}).then(res => {
  // handle success
  console.log(res.fileList)
}).catch(error => {
  // handle error
})

个结果 ""

    没有找到相关内容 ""