btoa 和 atob 报错“ERROR DOMException: String contains an invalid character”

改为:

存值:

sessionStorage.setItem("currentFormAnswerData", window.btoa(unescape(encodeURIComponent( JSON.stringify(rowDatas) ))))

取值:

JSON.parse(decodeURIComponent(escape(window.atob( sessionStorage.getItem('currentFormAnswerData') ))));

 

posted @ 2022-10-28 10:57  jahoon  阅读(346)  评论(0编辑  收藏  举报