html本地存储 localStorge
setLocalStorage:function(key,val){ var exp=new Date().getTime()+2*24*60*60*100; //令牌过期时间 var obj={ val:val, exp:exp }; localStorage.setItem(key,JSON.stringify(obj)); }, getLocalStorage:function(key){ var info= localStorage.getItem(key); if(info) { info = JSON.parse(info); if (info.exp > new Date().getTime()) { return info.val; } else{ this.deleteLocalStorage('token'); } } return ''; }, deleteLocalStorage:function(key){ return localStorage.removeItem(key); },
╰︶﹉⋛⋋⊱⋋๑๑⋌⊰⋌⋚﹉︶╯