记得上下班打卡 | git大法好,push需谨慎
Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
liquidnet-bus-v1
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
董敬伟
liquidnet-bus-v1
Commits
76d1149f
Commit
76d1149f
authored
Jul 14, 2021
by
张国柄
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:config:adam wechat;
parent
326c807e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
AdamLoginController.java
...iquidnet/service/adam/controller/AdamLoginController.java
+4
-4
No files found.
liquidnet-bus-service/liquidnet-service-adam/liquidnet-service-adam-impl/src/main/java/com/liquidnet/service/adam/controller/AdamLoginController.java
View file @
76d1149f
...
...
@@ -337,12 +337,12 @@ public class AdamLoginController {
public
ResponseDto
<
String
>
wxaCode2Session
(
@RequestParam
String
jsCode
)
{
String
openId
=
null
;
try
{
// String url = "https://api.weixin.qq.com/sns/jscode2session?appid=APPID&secret=SECRET&js_code=JSCODE&grant_type=authorization_code";
String
url
=
AdamWechatConst
.
API_URL_JS_CODE2SESSION
.
replace
(
"APPID"
,
AdamWechatConst
.
zhengzaiAppletAppid
)
.
replace
(
"SECRET"
,
AdamWechatConst
.
zhengzaiAppletSecret
).
replace
(
"JSCODE"
,
jsCode
);
String
respJStr
=
HttpUtil
.
get
(
url
,
null
);
JsonNode
respJNode
=
JsonUtils
.
fromJson
(
respJStr
,
JsonNode
.
class
);
if
(
null
==
respJNode
)
{
if
(
null
==
respJNode
||
!
respJNode
.
get
(
"errcode"
).
textValue
().
equalsIgnoreCase
(
"0"
))
{
log
.
warn
(
"WX.API调用失败[{}]"
,
respJStr
);
return
ResponseDto
.
success
(
null
);
}
openId
=
respJNode
.
get
(
"openid"
).
asText
();
...
...
@@ -358,12 +358,12 @@ public class AdamLoginController {
public
ResponseDto
<
String
>
wxOauth2AccessToken
(
@RequestParam
String
code
)
{
String
openId
=
null
;
try
{
// String url = "https://api.weixin.qq.com/sns/oauth2/access_token?appid=APPID&secret=SECRET&code=CODE&grant_type=authorization_code";
String
url
=
AdamWechatConst
.
API_URL_OAUTH2_ACCESS_TOKEN
.
replace
(
"APPID"
,
AdamWechatConst
.
zhengzaiServiceAppid
)
.
replace
(
"SECRET"
,
AdamWechatConst
.
zhengzaiServiceSecret
).
replace
(
"CODE"
,
code
);
String
respJStr
=
HttpUtil
.
get
(
url
,
null
);
JsonNode
respJNode
=
JsonUtils
.
fromJson
(
respJStr
,
JsonNode
.
class
);
if
(
null
==
respJNode
||
!
respJNode
.
get
(
"errcode"
).
isEmpty
())
{
if
(
null
==
respJNode
||
!
respJNode
.
get
(
"errcode"
).
textValue
().
equalsIgnoreCase
(
"0"
))
{
log
.
warn
(
"WX.API调用失败[{}]"
,
respJStr
);
return
ResponseDto
.
success
(
null
);
}
openId
=
respJNode
.
get
(
"openid"
).
asText
();
...
...
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