var obj = JSON.stringify(data.result); //转化为JSON字符串
localStorage.setItem("user", obj);//返回{"a":1,"b":2}
obj=JSON.parse(localStorage.getItem("user"));
console.log(obj)
复制代码
转载于:https://juejin.im/post/5a3217da6fb9a0451d417e2b
var obj = JSON.stringify(data.result); //转化为JSON字符串
localStorage.setItem("user", obj);//返回{"a":1,"b":2}
obj=JSON.parse(localStorage.getItem("user"));
console.log(obj)
复制代码
转载于:https://juejin.im/post/5a3217da6fb9a0451d417e2b