- API 概览
- 开放能力
- 基础
- 渲染
- 设备
- 文件
- 位置
- 媒体
- 网络
- 游戏转发分享
- 实时语音
- 数据缓存
- 系统
- 广告
- 界面
- 支付
- Worker
tt.clearStorage收藏我的收藏
收藏
我的收藏基础库 1.0.0 开始支持本方法,这是一个异步方法。
清理 全部 本地数据缓存。
前提条件 | 无 |
业务背景 | 无 |
使用限制 | 无 |
注意事项 | 无 |
相关教程 | 无 |
语法
tt.clearStorage(options)
参数说明
options 为 object 类型,属性如下:
属性名 | 类型 | 默认值 | 必填 | 说明 | 最低支持版本 |
---|---|---|---|---|---|
success | function | 否 | 接口调用成功的回调函数 | 1.0.0 | |
fail | function | 否 | 接口调用失败的回调函数 | 1.0.0 | |
complete | function | 否 | 接口调用结束的回调函数(调用成功、失败都会执行) | 1.0.0 |
回调成功
object 类型,属性如下:
属性名 | 类型 | 说明 | 最低支持版本 |
---|---|---|---|
errMsg | string | "clearStorage:ok" | 1.0.0 |
回调失败
object 类型,属性如下:
属性名 | 类型 | 说明 | 最低支持版本 |
---|---|---|---|
errMsg | string | "clearStorage: fail" + 详细错误信息 | 1.0.0 |
扫码体验
请使用字节宿主APP扫码
代码示例
tt.clearStorage({
success(res) {
console.log("clearStorage 调用成功", res);
},
fail(res) {
console.log("clearStorage 调用失败", res);
},
});
该文档是否有帮助?
点击纠错