localStorage 储存的数据关闭浏览器再打开也不会丢 用户主动清除缓存就没了 //值对都只能为字符串 localStorage.setItem('key','value') JSON.stringify(对象) localStorage.getItem('key') JSON