index.js 443 字节
Newer Older
X
xiaoyucoding 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
export function setStorageSync (key, data) {
  return my.setStorageSync({
    key,
    data
  })
}
export function getStorageSync (key) {
  const result = my.getStorageSync({
    key
  })
  // 不知道会不会出现 success 为 false 情况,暂时这样处理下。
  if (result.success) {
    return result.data || ''
  } else {
    return ''
  }
}
export function removeStorageSync (key) {
  return my.removeStorageSync({
    key
  })
}