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 @@
...
@@ -6,6 +6,7 @@
<title>
实名认证
</title>
<title>
实名认证
</title>
<!-- 引入该JS,全局注入getMetaInfo方法 -->
<!-- 引入该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://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>
<style>
body
{
body
{
-webkit-box-sizing
:
border-box
;
-webkit-box-sizing
:
border-box
;
...
@@ -74,7 +75,7 @@
...
@@ -74,7 +75,7 @@
}
}
console
.
log
(
'JSON.stringify(MetaInfo):'
,
JSON
.
stringify
(
MetaInfo
))
console
.
log
(
'JSON.stringify(MetaInfo):'
,
JSON
.
stringify
(
MetaInfo
))
// 请求认证业务接口获取CertifyUrl
// 请求认证业务接口获取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'
,
method
:
'POST'
,
headers
:
{
headers
:
{
'Content-Type'
:
'application/json'
,
'Content-Type'
:
'application/json'
,
...
@@ -85,15 +86,18 @@
...
@@ -85,15 +86,18 @@
.
then
(
response
=>
response
.
json
())
.
then
(
response
=>
response
.
json
())
.
then
(
data
=>
{
.
then
(
data
=>
{
// 获取CertifyUrl后跳转至认证页面
// 获取CertifyUrl后跳转至认证页面
window
.
location
.
href
=
data
.
data
.
certifyUrl
;
console
.
log
(
'data:'
,
data
)
}).
catch
(
error
=>
{
if
(
data
.
code
==
200
){
console
.
error
(
'Error:'
,
error
);
window
.
location
.
href
=
data
.
data
.
certifyUrl
;
// 遇到错误时隐藏加载指示器
}
else
if
(
data
.
code
==
null
||
data
.
code
==
'null'
){
document
.
getElementById
(
'loading-spinner'
).
style
.
display
=
'none'
;
//向小程序发送信息
// 可选:显示错误信息给用户
wx
.
miniProgram
.
postMessage
({
data
:
data
.
message
})
document
.
getElementById
(
'loading-message'
).
innerText
=
'发生错误,请刷新页面重试。'
;
//回退页面 不能使用别的 否则会有问题
document
.
getElementById
(
'loading-message'
).
style
.
color
=
'red'
;
wx
.
miniProgram
.
navigateBack
({
});
delta
:
1
})
}
})
</script>
</script>
</body>
</body>
</html>
</html>
public/realAuthDetail.html
View file @
6a9ab059
...
@@ -74,7 +74,7 @@
...
@@ -74,7 +74,7 @@
certifyId
:
certifyId
certifyId
:
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'
,
method
:
'POST'
,
headers
:
{
headers
:
{
'Content-Type'
:
'application/json'
'Content-Type'
:
'application/json'
...
@@ -82,22 +82,33 @@
...
@@ -82,22 +82,33 @@
body
:
JSON
.
stringify
(
data
)
body
:
JSON
.
stringify
(
data
)
})
})
.
then
(
response
=>
{
.
then
(
response
=>
{
console
.
log
(
'res'
,
response
)
return
response
.
json
()
return
response
.
json
()
})
})
.
then
(
data
=>
{
.
then
(
data
=>
{
console
.
log
(
'data'
,
data
)
console
.
log
(
'data'
,
data
)
wx
.
miniProgram
.
switchTab
({
if
(
data
.
code
==
200
){
url
:
'/pages/tab/my'
//进行认证了
})
if
(
data
.
data
.
passed
===
'T'
){
}).
catch
(
error
=>
{
//认证通过
console
.
error
(
'Error:'
,
error
);
wx
.
miniProgram
.
postMessage
({
data
:
'T'
})
// 遇到错误时隐藏加载指示器
wx
.
miniProgram
.
navigateBack
({
document
.
getElementById
(
'loading-spinner'
).
style
.
display
=
'none'
;
delta
:
3
// 可选:显示错误信息给用户
})
document
.
getElementById
(
'loading-message'
).
innerText
=
'发生错误,请刷新页面重试。'
;
}
else
if
(
data
.
data
.
passed
===
'F'
){
document
.
getElementById
(
'loading-message'
).
style
.
color
=
'red'
;
//认证未通过
});
wx
.
miniProgram
.
postMessage
({
data
:
'人脸识别错误,请重新认证'
})
//回退页面 不能使用别的 否则会有问题
wx
.
miniProgram
.
navigateBack
({
delta
:
1
})
}
}
else
{
//未进行认证
wx
.
miniProgram
.
navigateBack
({
delta
:
1
})
}
})
</script>
</script>
</body>
</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