Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
GaoQuYingJiH5-ASD
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
xinzhedeai
GaoQuYingJiH5-ASD
Commits
129f3d64
Commit
129f3d64
authored
Apr 15, 2025
by
lei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:引入index.js
parent
f39171dd
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
17 deletions
+17
-17
index.html
index.html
+4
-1
axios_http.js
sdk/axios_http.js
+1
-1
http.js
sdk/http.js
+6
-4
index.js
sdk/jssdk2/index.js
+6
-11
No files found.
index.html
View file @
129f3d64
...
...
@@ -31,7 +31,10 @@
document
.
write
(
'
<script type="text/javascript" src="sdk/jssdk2/index.js"><
\
/script>
'
)
}
</script>
<script
type=
"text/javascript"
src=
"./index.js"
></script>
<div
id=
"app"
class=
"page_wrapper"
...
...
sdk/axios_http.js
View file @
129f3d64
...
...
@@ -9,7 +9,7 @@ axios.defaults.timeout = 50000
axios
.
defaults
.
headers
.
post
[
'
Content-Type
'
]
=
'
application/json
'
// axios.defaults.headers.common['Authorization'] = gemhoUtil.getCookie('token')
axios
.
defaults
.
headers
.
common
[
'
Authorization
'
]
=
'
Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOi
LlvKDlrZ3lvakiLCJsb2dpbl91c2VyX2tleSI6IjNjMmRiMWFiLWIyZGMtNDBjYi04YjM5LWRiNTJmM2VmYzNkYyJ9.sfZyPP-COShNCjwxKR26zGDsPHXss97gu7JEpaMapIZyMQEsxzMigVickcqdhaqDwTRcfr0IxAj64vnrriS9C
w
'
'
Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOi
IxNTcyMTAzMTg4NiIsImxvZ2luX3VzZXJfa2V5IjoiMGFmNjhkZjItZjc3Ni00OTlkLTkzYjQtOGNkMmNlMDg2ZTVjIn0.NynQrQAUSqbWRGtjc00PHedLPvKdo0oHmHocwwdJmZyXQJjs0_B9_CeCeTs2PUkbEkRuYupzzPN3MvqtWC-GL
w
'
// 请求拦截器
axios
.
interceptors
.
request
.
use
((
config
)
=>
{
...
...
sdk/http.js
View file @
129f3d64
...
...
@@ -23,8 +23,8 @@ var http2 = {
JSON
.
stringify
(
params
.
reqParams
),
params
.
interfacePublicKey
)
console
.
log
(
'
http请求普通参数前
'
,
params
.
reqParams
)
console
.
log
(
'
http请求参数加密后
'
,
data
)
//
console.log('http请求普通参数前', params.reqParams)
//
console.log('http请求参数加密后', data)
const
extraData
=
{
// 公共请求头设置
// header: {
...
...
@@ -49,8 +49,8 @@ var http2 = {
// 用于接口传递的额外参数 如文件流等){
extraData
.
fileList
=
params
.
fileList
}
console
.
log
(
'
http请求额外参数
'
,
JSON
.
stringify
(
extraData
))
console
.
log
(
'
http2方法进来了~extraData
'
,
extraData
)
//
console.log('http请求额外参数', JSON.stringify(extraData))
//
console.log('http2方法进来了~extraData', extraData)
// vaildInterfacefn("gqyjglptxiefn", params.serviceId, data, "1", "https://" + urldomaincreatesign, "https://" + urldomaingateway).then((value) => {
vaildInterfacefn
(
...
...
@@ -97,6 +97,8 @@ var http2 = {
}
const
decryptRes
=
JSON
.
parse
(
sm2_decrypt_result
)
console
.
log
(
'
vaildInterfacefn响应解密
'
,
decryptRes
);
if
(
decryptRes
.
code
===
400
||
decryptRes
.
code
===
401
||
...
...
sdk/jssdk2/index.js
View file @
129f3d64
...
...
@@ -35,7 +35,7 @@ function getUserInfo() {
})
return
}
console
.
log
(
data
,
'
用户授权请求成功的数据
'
);
//
console.log(data, '用户授权请求成功的数据');
if
(
typeof
data
==
'
string
'
)
data
=
JSON
.
parse
(
data
)
...
...
@@ -55,11 +55,11 @@ function getUserInfo() {
let
aes_encrypt_result
=
sm2_decrypt_result
.
data
let
aes_decrypt_result
=
aes_Decrypt
(
aes_encrypt_result
,
appword
)
if
(
!
aes_decrypt_result
)
{
console
.
log
(
'
授权用户信息为空
'
)
//
console.log('授权用户信息为空')
return
}
let
tempResult
=
JSON
.
parse
(
aes_decrypt_result
)
console
.
log
(
'
授权用户信息
'
,
tempResult
)
//
console.log('授权用户信息', tempResult)
let
reqParammm
=
{
sex
:
tempResult
.
sex
,
mobile
:
tempResult
.
mobile
,
...
...
@@ -87,12 +87,7 @@ function getUserInfo() {
// localStorage.setItem('token', result.token)
if
(
result
.
code
==
200
)
{
gemhoUtil
.
setCookie
(
'
token
'
,
result
.
token
,
1
)
// 存储1天后过期
gemhoUtil
.
navigatePage
(
'
index.html
'
,
'
跳转中...
'
)
}
else
if
(
result
.
code
==
500
)
{
vant
.
Dialog
.
alert
({
title
:
'
信息提示
'
,
message
:
'
服务器错误,请联系管理员
'
,
})
// gemhoUtil.navigatePage('index.html', '跳转中...')
}
else
{
vant
.
Dialog
.
alert
({
title
:
'
信息提示
'
,
...
...
@@ -117,7 +112,7 @@ function getTicket() {
lightAppJssdk
.
user
.
getTicketWithoutDialog
({
success
:
function
(
res
)
{
//成功回调
console
.
log
(
JSON
.
stringify
(
res
)
+
1
)
//
console.log(JSON.stringify(res) + 1)
var
jsonData
=
JSON
.
parse
(
res
)
if
(
jsonData
.
retcode
==
'
000000
'
)
{
var
dataValueObj
=
JSON
.
parse
(
jsonData
.
data
)
...
...
@@ -131,7 +126,7 @@ function getTicket() {
},
fail
:
function
(
res
)
{
//错误返回
console
.
log
(
JSON
.
stringify
(
res
))
//
console.log(JSON.stringify(res))
resolve
(
res
)
// 成功时调用
},
})
...
...
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