|
楼主 |
发表于 2023-8-13 17:22:39
|
显示全部楼层
河南省焦作市
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title></title>
</head>
<body>
<p id="json" style="display:none">{"openId":"9d3e0310-1e3b-4b62-81b2-5a5ffb7aed8c","errorCode":"CIAM0005"}</p>
<!--<p id="errorCode" style="display:none" th:text="${errorCode}"></p>-->
</body>
</html>
<!--<!– uni 的 SDK –>-->
<!--<script type="text/javascript" src="https://js.cdn.aliyun.dcloud.net.cn/dev/uni-app/uni.webview.1.5.2.js"></script>-->
<script>
let json = document.getElementById("json").innerHTML;
const resultStr = htmlDecode(json);
if (window.ReactNativeWebView) {
window.ReactNativeWebView.postMessage(resultStr);
} else {
const result = JSON.parse(resultStr);
console.log("Response", result);
if (result.token && result.token.security) {
console.log("accessToken", result.token.security.accessToken);
}
}
function htmlDecode(text) {
var temp = document.createElement("div");
temp.innerHTML = text;
var output = temp.innerText || temp.textContent;
temp = null;
return output;
}
</script>
一键解码 解出来要不就是原文 要不就是 乱的 你可以试一下 老哥 |
|