uni-app数据缓存

同步

读取: const value = uni.getStorageSync('storage_key');
写入: uni.setStorageSync('storage_key', 'hello');

异步

读取:
uni.getStorage({
    key: 'storage_key',
    success: function (res) {
        console.log(res.data);
    }
});
写入:
  uni.setStorage({
    key: 'storage_key',
    data: 'hello',
    success: function () {
        console.log('success');
    }
});