JS本地存储操作

//本地存储操作
var localStorageUtils = {
setParam: function (name, value) {
if (value) {
localStorage.setItem(name, JSON.stringify(value));
}
},
getParam: function (name) {
var obj = localStorage.getItem(name);
return JSON.parse(obj);
},
removeParam: function (key) {
return localStorage.removeItem(key);
}
}

posted @ 2019-08-14 16:01  天外小龙虾  阅读(643)  评论(0编辑  收藏  举报