获取缓存


接口说明

获取指定key值的缓存。

HWH5.getStorage

  • 基础库从 10.0.5 开始支持,低版本需做兼容处理
  • cache在后续版本中将会逐渐废弃,请使用getStorage代替

请求参数

参数 类型 必填 说明
key String 存、取缓存数据的key

返回结果

参数 说明
data 缓存的数据

请求示例

  • ES6版本

    HWH5.getStorage('bulletin_detail_c00299309_10010')
      .then(data => {
        console.log(data);
      })
      .catch(error => {
        console.log('获取缓存异常', error);
      });
    
  • ES5版本

    HWH5.getStorage('bulletin_detail_c00299309_10010')
      .then(function (data) {
        console.log(data);
      })
      .catch(function (error) {
        console.log('获取缓存异常', error);
      });
    

result. ""

    Not Found. ""