Commit 3a36c85d authored by 罗林杰's avatar 罗林杰

Merge remote-tracking branch 'origin/master'

parents 0d021c03 cf6a4c7e
......@@ -3,13 +3,59 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Title</title>
<title>实名认证</title>
<!-- 引入该JS,全局注入getMetaInfo方法 -->
<script type="text/javascript" src="https://o.alicdn.com/yd-cloudauth/cloudauth-cdn/jsvm_all.js"></script>
<style>
body {
-webkit-box-sizing: border-box;
box-sizing: border-box;
height: 100vh;
padding: 0;
margin: 0;
font-family: Arial;
}
.flexbox {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
}
.nb-spinner {
width: 75px;
height: 75px;
margin: 0;
background: transparent;
border-top: 4px solid #009688;
border-right: 4px solid transparent;
border-radius: 50%;
-webkit-animation: 1s spin linear infinite;
animation: 1s spin linear infinite;
}
@keyframes spin {
from {
-webkit-transform: rotate(0deg);
transform: rotate(0deg);
}
to {
-webkit-transform: rotate(360deg);
transform: rotate(360deg);
}
}
</style>
</head>
<body>
<div>1111111</div>
<div id="loading-container" class="flexbox">
<div>
<div style="display: flex;justify-content: center;align-items: center;">
<div id="loading-spinner" class="nb-spinner"></div>
</div>
<div id="loading-message" style="margin-bottom: 20px;margin-top: 20px">正在跳转中,请稍等.....</div>
</div>
</div>
<script>
// 获取当前页面的URL
const url = window.location.href;
......@@ -28,7 +74,7 @@
}
console.log('JSON.stringify(MetaInfo):',JSON.stringify(MetaInfo))
// 请求认证业务接口获取CertifyUrl
fetch('http://192.168.1.7:8092/faceVerify/initFaceVerify', {
fetch('http://106.3.97.198:20162/faceVerify/initFaceVerify', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
......@@ -40,7 +86,14 @@
.then(data => {
// 获取CertifyUrl后跳转至认证页面
window.location.href = data.data.certifyUrl;
});
}).catch(error => {
console.error('Error:', error);
// 遇到错误时隐藏加载指示器
document.getElementById('loading-spinner').style.display = 'none';
// 可选:显示错误信息给用户
document.getElementById('loading-message').innerText = '发生错误,请刷新页面重试。';
document.getElementById('loading-message').style.color = 'red';
});
</script>
</body>
</html>
......@@ -2,40 +2,103 @@
<html lang="en">
<head>
<meta charset="utf-8">
<title>Title</title>
<title>实名认证</title>
<script type="text/javascript" src="https://res.wx.qq.com/open/js/jweixin-1.3.2.js"></script>
<style>
body {
-webkit-box-sizing: border-box;
box-sizing: border-box;
height: 100vh;
padding: 0;
margin: 0;
font-family: Arial;
}
.flexbox {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
}
.nb-spinner {
width: 75px;
height: 75px;
margin: 0;
background: transparent;
border-top: 4px solid #009688;
border-right: 4px solid transparent;
border-radius: 50%;
-webkit-animation: 1s spin linear infinite;
animation: 1s spin linear infinite;
}
@keyframes spin {
from {
-webkit-transform: rotate(0deg);
transform: rotate(0deg);
}
to {
-webkit-transform: rotate(360deg);
transform: rotate(360deg);
}
}
</style>
</head>
<body>
<div>222222</div>
<div id="loading-container" class="flexbox">
<div>
<div style="display: flex;justify-content: center;align-items: center;">
<div id="loading-spinner" class="nb-spinner"></div>
</div>
<div id="loading-message" style="margin-bottom: 20px;margin-top: 20px">正在跳转中,请稍等.....</div>
</div>
</div>
<script>
// 此时的window.location.href就是ReturnUrl了。
// 格式为:https://aliyundoc.com 或 https://aliyundoc.com/index.html
console.log('window.location.href:', window.location.href)
let url = new URL(window.location.href);
console.log('url:', url)
// 获取返回的认证结果数据。
let parms = url.searchParams.get('response')
console.log('parms:', parms)
let params = url.searchParams.get('response')
console.log('params:', params)
let userId = url.searchParams.get('userId')
console.log('userId:',userId)
// 如果需要二次验证实人认证结果可参考下面代码。
// 获取CertifyId 为了避免盗链和篡改风险,请自行管理此ID和真实认证人的关系。
var certifyId = JSON.parse(parms).extInfo.certifyId
function describe() {
// 携带CertifyId
fetch('http://获取认证详细数据接口地址', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: certifyId
var certifyId = JSON.parse(params).extInfo.certifyId
console.log('certifyId:', certifyId)
const data = {
userId: userId,
certifyId: certifyId
}
// 携带CertifyId
fetch('http://106.3.97.198:20162/faceVerify/describeFaceVerify', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(data)
})
.then(response => {
console.log('res', response)
return response.json()
})
.then(response => {
console.log('res', response)
return response.json()
})
.then(data => {
console.log('data', data)
document.getElementById('detail').innerHTML = JSON.stringify(data)
.then(data => {
console.log('data', data)
wx.miniProgram.switchTab({
url: '/pages/tab/my'
})
}
}).catch(error => {
console.error('Error:', error);
// 遇到错误时隐藏加载指示器
document.getElementById('loading-spinner').style.display = 'none';
// 可选:显示错误信息给用户
document.getElementById('loading-message').innerText = '发生错误,请刷新页面重试。';
document.getElementById('loading-message').style.color = 'red';
});
</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