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
5641b37e
Commit
5641b37e
authored
Jul 26, 2024
by
xinzhedeai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
详情出问题 刷新接口 解密为空则重新处理
parent
9f9b5168
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
12 deletions
+24
-12
index.html
index.html
+1
-1
http.js
sdk/http.js
+15
-10
law-list-detail.js
src/law-list-detail.js
+4
-0
notice-list-detail.js
src/notice-list-detail.js
+4
-1
No files found.
index.html
View file @
5641b37e
sdk/http.js
View file @
5641b37e
...
@@ -15,9 +15,8 @@ var http2 = {
...
@@ -15,9 +15,8 @@ var http2 = {
*
*
*/
*/
const
data
=
SM
.
encrypt
(
JSON
.
stringify
(
params
.
reqParams
),
params
.
interfacePublicKey
)
const
data
=
SM
.
encrypt
(
JSON
.
stringify
(
params
.
reqParams
),
params
.
interfacePublicKey
)
console
.
log
(
'
http请求普通参数前
'
,
params
.
reqParams
)
console
.
log
(
'
http2方法进来了~普通请求参数
'
,
JSON
.
stringify
(
params
.
reqParams
))
console
.
log
(
'
http请求参数加密后
'
,
data
)
const
extraData
=
{
// 公共请求头设置
const
extraData
=
{
// 公共请求头设置
// header: {
// header: {
// // Authorization: "Bearer eyJhbGciOiJIUzUxMiJ9.eyJqdGkiOiI0ODA3ODFkZmQxYmE0MmM0OGQyZDQ5NTllYzcyYTUwNCIsInVzZXIiOiJqYyIsInN1YiI6ImpjIn0.WfLq11T7iWPiMuzqDY2N54aIqdv-ciYCe6pINqQAeBdqlMiJmkufsqlD2YMmUzsHA-o4WerkiSYnPzexEMiAJA"
// // Authorization: "Bearer eyJhbGciOiJIUzUxMiJ9.eyJqdGkiOiI0ODA3ODFkZmQxYmE0MmM0OGQyZDQ5NTllYzcyYTUwNCIsInVzZXIiOiJqYyIsInN1YiI6ImpjIn0.WfLq11T7iWPiMuzqDY2N54aIqdv-ciYCe6pINqQAeBdqlMiJmkufsqlD2YMmUzsHA-o4WerkiSYnPzexEMiAJA"
...
@@ -34,11 +33,12 @@ var http2 = {
...
@@ -34,11 +33,12 @@ var http2 = {
if
(
params
.
fileList
){
// 用于接口传递的额外参数 如文件流等){
if
(
params
.
fileList
){
// 用于接口传递的额外参数 如文件流等){
extraData
.
fileList
=
params
.
fileList
extraData
.
fileList
=
params
.
fileList
}
}
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("gqyjglptxiefn", params.serviceId, data, "1", "https://" + urldomaincreatesign, "https://" + urldomaingateway).then((value) => {
vaildInterfacefn
(
"
gqyjglptxiefn
"
,
params
.
serviceId
,
data
,
"
1
"
,
extraData
).
then
((
value
)
=>
{
vaildInterfacefn
(
"
gqyjglptxiefn
"
,
params
.
serviceId
,
data
,
"
1
"
,
extraData
).
then
((
value
)
=>
{
// console.log('vaildInterfacefn响应
', value)
console
.
log
(
'
vaildInterfacefn响应value
'
,
value
)
/**
/**
* code: 200
* code: 200
data: "048b04671ad85e52e" // value 值就是接口返回的data值
data: "048b04671ad85e52e" // value 值就是接口返回的data值
...
@@ -46,11 +46,11 @@ var http2 = {
...
@@ -46,11 +46,11 @@ var http2 = {
success: true
success: true
*/
*/
if
(
!
value
){
if
(
!
value
){
vant
.
Dialog
.
alert
({
//
vant.Dialog.alert({
title
:
'
信息提示
'
,
//
title: '信息提示',
message
:
'
网络异常, 请重试
'
,
//
message: '网络异常, 请重试',
// message: '请求异常'
//
// message: '请求异常'
})
//
})
fn
&&
fn
(
null
)
fn
&&
fn
(
null
)
return
return
}
}
...
@@ -60,6 +60,11 @@ var http2 = {
...
@@ -60,6 +60,11 @@ var http2 = {
let
sm2_decrypt_result
=
sm2_Decrypt
(
sm2_encrypt_result
,
params
.
interfacePrivateKey
)
let
sm2_decrypt_result
=
sm2_Decrypt
(
sm2_encrypt_result
,
params
.
interfacePrivateKey
)
console
.
log
(
'
vaildInterfacefn响应解密
'
,
sm2_decrypt_result
)
console
.
log
(
'
vaildInterfacefn响应解密
'
,
sm2_decrypt_result
)
if
(
!
sm2_decrypt_result
){
// 解密为空字符串
fn
&&
fn
(
null
)
return
}
const
decryptRes
=
JSON
.
parse
(
sm2_decrypt_result
)
const
decryptRes
=
JSON
.
parse
(
sm2_decrypt_result
)
if
(
decryptRes
.
code
===
400
||
decryptRes
.
code
===
401
||
decryptRes
.
status
===
401
){
if
(
decryptRes
.
code
===
400
||
decryptRes
.
code
===
401
||
decryptRes
.
status
===
401
){
vant
.
Dialog
.
alert
({
vant
.
Dialog
.
alert
({
...
...
src/law-list-detail.js
View file @
5641b37e
...
@@ -32,6 +32,10 @@ window.addEventListener("load", function() {
...
@@ -32,6 +32,10 @@ window.addEventListener("load", function() {
lawId
:
gemhoUtil
.
getParameter
(
'
law_id
'
)
lawId
:
gemhoUtil
.
getParameter
(
'
law_id
'
)
}
}
},
(
res
)
=>
{
},
(
res
)
=>
{
if
(
!
res
){
// 中台返回为undefined 重新请求
this
.
detail
()
return
}
if
(
res
){
if
(
res
){
console
.
log
(
'
接口回调数据
'
,
JSON
.
parse
(
res
))
console
.
log
(
'
接口回调数据
'
,
JSON
.
parse
(
res
))
var
result
=
JSON
.
parse
(
res
)
var
result
=
JSON
.
parse
(
res
)
...
...
src/notice-list-detail.js
View file @
5641b37e
...
@@ -30,7 +30,10 @@ window.addEventListener("load", function() {
...
@@ -30,7 +30,10 @@ window.addEventListener("load", function() {
noticeId
:
gemhoUtil
.
getParameter
(
'
noticeId
'
)
noticeId
:
gemhoUtil
.
getParameter
(
'
noticeId
'
)
}
}
},
(
res
)
=>
{
},
(
res
)
=>
{
if
(
!
res
){
// 中台返回为undefined 重新请求
this
.
detail
()
return
}
if
(
res
){
if
(
res
){
console
.
log
(
'
接口回调数据
'
,
JSON
.
parse
(
res
))
console
.
log
(
'
接口回调数据
'
,
JSON
.
parse
(
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