uni.setStorageSync(KEY,DATA)

将 data 存储在本地缓存中指定的 key 中,会覆盖掉原来该 key 对应的内容,这是一个同步接口。 参数说明

  1. try { uni.setStorageSync('storage_key', 'hello');} catch (e) { // error}