标签:str 解密 obb add 加密 storage oca OLE encodeuri
var obj={name:"致远",age:21,address:"江西上饶XXXX",hobby:"看书,编程"};
//用中文 记得加encodeURIComponent()!
localStorage.setItem("obj",window.btoa(window.encodeURIComponent(JSON.stringify(obj))));
//用中文 记得加decodeURIComponent()!
var obj=JSON.parse(decodeURIComponent(window.atob(localStorage.getItem("obj"))));
console.info(obj);
加密对象到locastorage / 从 locastorage解密对象
标签:str 解密 obb add 加密 storage oca OLE encodeuri
原文地址:https://www.cnblogs.com/7qin/p/10198208.html