Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
windows
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
zhanhai
windows
Commits
9c36f6fc
Commit
9c36f6fc
authored
Oct 23, 2023
by
张庆
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增挡板规则
parent
b8840859
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
4 deletions
+7
-4
AbcHttpClient.java
src/main/java/com/jqtx/windows/utils/AbcHttpClient.java
+7
-4
No files found.
src/main/java/com/jqtx/windows/utils/AbcHttpClient.java
View file @
9c36f6fc
...
...
@@ -27,23 +27,26 @@ public class AbcHttpClient {
public
JsonResult
postRequest
(
String
paramJson
,
String
method
)
{
try
{
final
String
url
=
posetUrl
+
method
;
final
String
url
=
posetUrl
+
method
;
AbcRequest
request
=
AbcRsaUtil
.
encodeParam
(
paramJson
,
ypdPublicKey
,
appId
,
privateKey
);
log
.
info
(
"请求浙农request:{}, url:{}"
,
JSON
.
toJSONString
(
request
),
url
);
log
.
info
(
"请求浙农未加密数据:{}"
,
JSON
.
toJSONString
(
paramJson
));
log
.
info
(
"请求浙农加密数据:{}"
,
JSON
.
toJSONString
(
request
));
log
.
info
(
"请求浙农url:{}"
,
url
);
HttpResponse
response
=
HttpRequest
.
post
(
url
).
body
(
JSON
.
toJSONString
(
request
)).
setConnectionTimeout
(
5000
).
execute
();
log
.
info
(
"浙农加密返回数据:{}"
,
JSON
.
toJSONString
(
response
.
body
()));
if
(
response
.
getStatus
()
==
200
&&
StringUtils
.
isNotBlank
(
response
.
body
()))
{
final
String
body
=
response
.
body
();
log
.
info
(
"请求浙农response:{}"
,
body
);
JSONObject
responseJson
=
JSONObject
.
parseObject
(
body
);
String
content
=
responseJson
.
getString
(
"content"
);
String
sign
=
responseJson
.
getString
(
"sign"
);
String
responseParam
=
AbcRsaUtil
.
decodeParam
(
content
,
sign
,
privateKey
,
ypdPublicKey
);
log
.
info
(
"浙农解密返回数据:{}"
,
JSON
.
toJSONString
(
responseParam
));
return
JSONObject
.
parseObject
(
responseParam
,
JsonResult
.
class
);
}
else
{
throw
new
Exception
(
"请求异常"
);
}
}
catch
(
Exception
e
)
{
log
.
error
(
"请求浙农异常:{}"
,
e
.
getMessage
(),
e
);
log
.
error
(
"请求浙农异常:{}"
,
e
.
getMessage
(),
e
);
return
null
;
}
}
...
...
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