存
//存储,IE6~7 cookie 其他浏览器HTML5本地存储
if (window.localStorage) {
localStorage.setItem("token", token);
console.log("本地存储")
} else {
Cookie.write("token", token);
console.log("Cookie存储")
}
取
//获取存储的token
var token = window.localStorage? localStorage.getItem("token"): Cookie.read("token");
console.log(token)
网友评论