抖音开放平台Logo
控制台

tt.clearStorage
收藏
我的收藏

基础库 1.0.0 开始支持本方法,这是一个异步方法。

清理 全部 本地数据缓存。

前提条件
业务背景
使用限制
注意事项
相关教程

语法

tt.clearStorage(options)

参数说明

options 为 object 类型,属性如下:

属性名类型默认值必填说明最低支持版本
successfunction
接口调用成功的回调函数
1.0.0
failfunction
接口调用失败的回调函数
1.0.0
completefunction
接口调用结束的回调函数(调用成功、失败都会执行)
1.0.0

回调成功

object 类型,属性如下:

属性名类型说明最低支持版本
errMsgstring

"clearStorage:ok"

1.0.0

回调失败

object 类型,属性如下:

属性名类型说明最低支持版本
errMsgstring

"clearStorage: fail" + 详细错误信息

1.0.0

扫码体验

请使用字节宿主APP扫码

代码示例

开发者工具中预览

tt.clearStorage({
  success(res) {
    console.log("clearStorage 调用成功", res);
  },
  fail(res) {
    console.log("clearStorage 调用失败", res);
  },
});