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
b1e37d5b
Commit
b1e37d5b
authored
Jan 11, 2025
by
liwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
小程序端跳转的h5页面
parent
44e52da2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
47 additions
and
0 deletions
+47
-0
test.html
public/test.html
+47
-0
No files found.
public/test.html
0 → 100644
View file @
b1e37d5b
<!DOCTYPE HTML>
<html
lang=
"en"
>
<head>
<meta
charset=
"utf-8"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1"
>
<title>
Title
</title>
<!-- 引入该JS,全局注入getMetaInfo方法 -->
<script
type=
"text/javascript"
src=
"https://o.alicdn.com/yd-cloudauth/cloudauth-cdn/jsvm_all.js"
></script>
</head>
<body>
<div>
1111111
</div>
<script>
// 获取当前页面的URL
const
url
=
window
.
location
.
href
;
// 创建一个新的URL对象
const
urlObj
=
new
URL
(
url
);
// 使用URLSearchParams来获取参数
const
params
=
new
URLSearchParams
(
urlObj
.
search
);
// 获取uniapp用户的token
var
token
=
params
.
get
(
'token'
);
// 替换'token'为实际参数名
console
.
log
(
'Token:'
,
token
);
// 在调用实人认证服务端发起认证请求时需要传入该MetaInfo值
var
MetaInfoChildren
=
window
.
getMetaInfo
();
console
.
log
(
'MetaInfo:'
,
MetaInfo
)
var
MetaInfo
=
{
metaInfo
:
JSON
.
stringify
(
MetaInfoChildren
),
}
console
.
log
(
'JSON.stringify(MetaInfo):'
,
JSON
.
stringify
(
MetaInfo
))
// 请求认证业务接口获取CertifyUrl
fetch
(
'http://localhost:8092/faceVerify/initFaceVerify'
,
{
method
:
'POST'
,
headers
:
{
'Content-Type'
:
'application/json'
,
'Authorization'
:
'Bearer '
+
token
},
body
:
JSON
.
stringify
(
MetaInfo
)
})
.
then
(
response
=>
response
.
json
())
.
then
(
data
=>
{
console
.
log
(
'data:'
,
data
)
// 获取CertifyUrl后跳转至认证页面
window
.
location
.
href
=
data
.
resultObject
.
certifyUrl
;
});
</script>
</body>
</html>
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