# getGlobalAppCache^8.0

获取APP中的数据,先从内存中获取,如果没有则从磁盘中获取,如果都没有则返回空(数据共享权限范围:app内)

# 调用方式

getGlobalAppCache(key)
1

返回 Promise,使用 then/catch 或 await 处理结果。

# 请求参数

参数 类型 必填 默认值 说明
key String Y — 需要读取的缓存键

# 接口调用示例

this.$bridge.getGlobalAppCache('example-key')
  .then(res => {
    console.log(res)
  })
  .catch(error => {
    console.error(error)
  })
1
2
3
4
5
6
7

# 返回参数

返回 Promise,resolve 原生结果 data 中该 key 对应的值,而不是完整的 { data: ... } 对象。