Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cust_web
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张伯涛
cust_web
Commits
6a9ab059
Commit
6a9ab059
authored
Jan 15, 2025
by
liwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改了实名认证页面,修改了处理逻辑
parent
cf6a4c7e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
23 deletions
+38
-23
realAuth.html
public/realAuth.html
+14
-10
realAuthDetail.html
public/realAuthDetail.html
+24
-13
No files found.
public/realAuth.html
View file @
6a9ab059
...
...
@@ -6,6 +6,7 @@
<title>
实名认证
</title>
<!-- 引入该JS,全局注入getMetaInfo方法 -->
<script
type=
"text/javascript"
src=
"https://o.alicdn.com/yd-cloudauth/cloudauth-cdn/jsvm_all.js"
></script>
<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
;
...
...
@@ -74,7 +75,7 @@
}
console
.
log
(
'JSON.stringify(MetaInfo):'
,
JSON
.
stringify
(
MetaInfo
))
// 请求认证业务接口获取CertifyUrl
fetch
(
'http://1
06.3.97.198:2016
2/faceVerify/initFaceVerify'
,
{
fetch
(
'http://1
92.168.1.7:809
2/faceVerify/initFaceVerify'
,
{
method
:
'POST'
,
headers
:
{
'Content-Type'
:
'application/json'
,
...
...
@@ -85,15 +86,18 @@
.
then
(
response
=>
response
.
json
())
.
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'
;
});
console
.
log
(
'data:'
,
data
)
if
(
data
.
code
==
200
){
window
.
location
.
href
=
data
.
data
.
certifyUrl
;
}
else
if
(
data
.
code
==
null
||
data
.
code
==
'null'
){
//向小程序发送信息
wx
.
miniProgram
.
postMessage
({
data
:
data
.
message
})
//回退页面 不能使用别的 否则会有问题
wx
.
miniProgram
.
navigateBack
({
delta
:
1
})
}
})
</script>
</body>
</html>
public/realAuthDetail.html
View file @
6a9ab059
...
...
@@ -74,7 +74,7 @@
certifyId
:
certifyId
}
// 携带CertifyId
fetch
(
'http://1
06.3.97.198:2016
2/faceVerify/describeFaceVerify'
,
{
fetch
(
'http://1
92.168.1.7:809
2/faceVerify/describeFaceVerify'
,
{
method
:
'POST'
,
headers
:
{
'Content-Type'
:
'application/json'
...
...
@@ -82,22 +82,33 @@
body
:
JSON
.
stringify
(
data
)
})
.
then
(
response
=>
{
console
.
log
(
'res'
,
response
)
return
response
.
json
()
})
.
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'
;
});
if
(
data
.
code
==
200
){
//进行认证了
if
(
data
.
data
.
passed
===
'T'
){
//认证通过
wx
.
miniProgram
.
postMessage
({
data
:
'T'
})
wx
.
miniProgram
.
navigateBack
({
delta
:
3
})
}
else
if
(
data
.
data
.
passed
===
'F'
){
//认证未通过
wx
.
miniProgram
.
postMessage
({
data
:
'人脸识别错误,请重新认证'
})
//回退页面 不能使用别的 否则会有问题
wx
.
miniProgram
.
navigateBack
({
delta
:
1
})
}
}
else
{
//未进行认证
wx
.
miniProgram
.
navigateBack
({
delta
:
1
})
}
})
</script>
</body>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment