12345678910111213141516171819202122232425262728293031 |
- export default {
-
- set(name,value){
- uni.setStorageSync(name,value);
- },
-
- get(name){
- return uni.getStorageSync(name);
- },
-
- setJson(name,value){
- uni.setStorageSync(name,JSON.stringify(value));
- },
-
- getJson(name){
- const content = uni.getStorageSync(name);
- if(!content){
- return null;
- }
-
- return JSON.parse(content);
- },
-
- remove(name = ''){
- uni.removeStorageSync(name);
- },
-
- clear(){
- uni.clearStorageSync();
- }
- };
|