Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
Project
Project
Details
Activity
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
项目统一框架
amos-boot-biz
Commits
f0eabeac
Commit
f0eabeac
authored
May 23, 2023
by
曹盼盼
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改
parent
ec4adb06
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
7 deletions
+11
-7
TzsAppService.java
.../amos/boot/module/tzs/biz/service/impl/TzsAppService.java
+11
-7
No files found.
amos-boot-system-tzs/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/biz/service/impl/TzsAppService.java
View file @
f0eabeac
...
@@ -390,7 +390,7 @@ public class TzsAppService {
...
@@ -390,7 +390,7 @@ public class TzsAppService {
public
JSONObject
wxUserLogin
(
JSONObject
wx
)
{
public
JSONObject
wxUserLogin
(
JSONObject
wx
)
{
if
(
redisUtils
.
hasKey
(
WXUSER_TOKEN
))
{
/*
if (redisUtils.hasKey(WXUSER_TOKEN)) {
Object obj= redisUtils.get(WXUSER_TOKEN);
Object obj= redisUtils.get(WXUSER_TOKEN);
return JSONObject.parseObject(obj.toString());
return JSONObject.parseObject(obj.toString());
}else {
}else {
...
@@ -404,23 +404,27 @@ public class TzsAppService {
...
@@ -404,23 +404,27 @@ public class TzsAppService {
System.out.println("666"+response.getString("session_key"));
System.out.println("666"+response.getString("session_key"));
} catch (Exception e) {
} catch (Exception e) {
throw
new
BadRequest
(
"
获取token
出错:"
+
e
.
getMessage
());
throw new BadRequest("
session_key
出错:" + e.getMessage());
}
}
if(response.get("session_key") != null) { // 获取token 成功
if(response.get("session_key") != null) { // 获取token 成功
try {
try {
redisUtils.set(WXUSER_TOKEN, response,time);
redisUtils.set(WXUSER_TOKEN, response,time);
return response;
return response;
} catch (Exception e) {
} catch (Exception e) {
throw
new
BadRequest
(
"
获取token
出错:"
+
e
.
getMessage
());
throw new BadRequest("
session_key
出错:" + e.getMessage());
}
}
} else {
} else {
throw
new
BadRequest
(
"
获取token
出错:"
+
response
);
throw new BadRequest("
session_key
出错:" + response);
}
}
}
}*/
StringBuffer
buffer
=
new
StringBuffer
(
"https://api.weixin.qq.com/sns/jscode2session?appid="
)
.
append
(
wx
.
getString
(
"appid"
)).
append
(
"&secret="
).
append
(
wx
.
getString
(
"secret"
)).
append
(
"&js_code="
).
append
(
wx
.
getString
(
"js_code"
))
.
append
(
"&grant_type="
).
append
(
wx
.
getString
(
"grant_type"
));
String
responseStr
=
HttpUtils
.
doGet
(
buffer
.
toString
());
JSONObject
response
=
JSONObject
.
parseObject
(
responseStr
);
return
response
;
}
}
}
}
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