storage.js
382 Bytes
/**
* local storage 操作
*/
module.exports = function(name, value) {
if (typeof value != 'undefined') {
if (window.localStorage) {
window.localStorage.setItem(name, value)
}
} else {
var value = null;
if (window.localStorage) {
value = window.localStorage.getItem(name);
}
return value;
}
};