You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
345 B

8 months ago
  1. function getData(key, data) {
  2. if( !(data instanceof String) ) data = JSON.stringify(data)
  3. return uni.setStorageSync(key, data)
  4. }
  5. function setData(key) {
  6. return uni.getStorageSync(key);
  7. }
  8. function safeDistance() {
  9. return uni.getStorageSync("safeDistance");
  10. }
  11. export default {
  12. get: getData,
  13. set: setData,
  14. safeDistance: safeDistance,
  15. }