Commit e262418f authored by liwei's avatar liwei

新增了html页面

parent 6574f147
......@@ -28,7 +28,7 @@
}
console.log('JSON.stringify(MetaInfo):',JSON.stringify(MetaInfo))
// 请求认证业务接口获取CertifyUrl
fetch('http://localhost:8092/faceVerify/initFaceVerify', {
fetch('http://192.168.1.7:8092/faceVerify/initFaceVerify', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
......@@ -38,9 +38,8 @@
})
.then(response => response.json())
.then(data => {
console.log('data:', data)
// 获取CertifyUrl后跳转至认证页面
window.location.href = data.resultObject.certifyUrl;
window.location.href = data.data.certifyUrl;
});
</script>
</body>
......
<!DOCTYPE HTML>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Title</title>
</head>
<body>
<div>222222</div>
<script>
// 此时的window.location.href就是ReturnUrl了。
// 格式为:https://aliyundoc.com 或 https://aliyundoc.com/index.html
let url = new URL(window.location.href);
// 获取返回的认证结果数据。
let parms = url.searchParams.get('response')
console.log('parms:', parms)
// 如果需要二次验证实人认证结果可参考下面代码。
// 获取CertifyId 为了避免盗链和篡改风险,请自行管理此ID和真实认证人的关系。
var certifyId = JSON.parse(parms).extInfo.certifyId
function describe() {
// 携带CertifyId
fetch('http://获取认证详细数据接口地址', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: certifyId
})
.then(response => {
console.log('res', response)
return response.json()
})
.then(data => {
console.log('data', data)
document.getElementById('detail').innerHTML = JSON.stringify(data)
})
}
</script>
</body>
</html>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment