wx.removesavedfile小程序怎么删除本地存储的文件
2020-12-07
导读:wx.removeSavedFile(OBJECT) 删除本地存储的文件 OBJECT参数说明: 参数 类型 必填 说明 filePath String 是 需要删除的文件路径 success Function 否 接口调用成功的回调函...
wx.removeSavedFile(OBJECT)
删除本地存储的文件
OBJECT参数说明:
参数 | 类型 | 必填 | 说明 |
---|---|---|---|
filePath | String | 是 | 需要删除的文件路径 |
success | Function | 否 | 接口调用成功的回调函数 |
fail | Function | 否 | 接口调用失败的回调函数 |
complete | Function | 否 | 接口调用结束的回调函数(调用成功、失败都会执行) |
示例代码:
wx.getSavedFileList({
success: function(res) {
if (res.fileList.length > 0){
wx.removeSavedFile({
filePath: res.fileList[0].filePath,
complete: function(res) {
console.log(res)
}
})
}
}
})
第二部分:如何开通一个小商店