普通存取
//存
localStorage.setItem('name',"张三");
//取
var data = localStorage.getItem("name");
//删除指定
localStorage.removeItem("name");
//删除全部
localStorage.clear();
加密解密存取
//存
localStorage.setItem("name",window.btoa(window.encodeURIComponent(JSON.stringify('张三'))));
//取
let name = JSON.parse(decodeURIComponent(window.atob(localStorage.getItem("name"))));