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:56  jahoon  阅读(449)  评论(0)    收藏  举报