Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
AuthorizeLogin
Overview
Overview
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
虞诚毅
AuthorizeLogin
Commits
46902c19
Commit
46902c19
authored
Apr 19, 2019
by
303514581@qq.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
2019/4/19 wechat js ticket接口再调整
parent
a6109c2a
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletions
+4
-1
src/main/java/com/zhiwei/controller/WapWechatLoginController.java
+4
-1
No files found.
src/main/java/com/zhiwei/controller/WapWechatLoginController.java
View file @
46902c19
...
...
@@ -5,6 +5,7 @@ import java.io.IOException;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.http.HttpResponse
;
import
org.apache.http.HttpStatus
;
import
org.apache.http.client.HttpClient
;
...
...
@@ -23,6 +24,7 @@ import com.alibaba.fastjson.JSONObject;
import
com.zhiwei.Tool.GetWechatOpenUrl
;
import
com.zhiwei.Tool.Tools
;
import
com.zhiwei.config.WechatConfig
;
import
com.zhiwei.crawler.utils.TimeUtils
;
import
com.zhiwei.entity.TokenEntity
;
import
com.zhiwei.entity.WeChatTokenEntity
;
...
...
@@ -119,7 +121,7 @@ public class WapWechatLoginController {
@RequestMapping
(
"/wapwechat/jsapiticket"
)
public
String
wapJsapiTicket
(
HttpServletResponse
response
,
HttpServletRequest
request
)
{
try
{
if
(
ticket
!=
null
&&
((
System
.
currentTimeMillis
()
-
ticketTime
)
<
(
ticket_expires_in
*
1000L
)))
{
if
(
!
StringUtils
.
isEmpty
(
ticket
)
&&
((
System
.
currentTimeMillis
()
-
ticketTime
)
<
(
ticket_expires_in
*
1000L
)))
{
}
else
{
String
tokenRes
=
Tools
.
httpGet
(
AccessTokenUrl
);
JSONObject
tokenInfo
=
JSONObject
.
parseObject
(
tokenRes
);
...
...
@@ -132,6 +134,7 @@ public class WapWechatLoginController {
ticket_expires_in
=
ticketInfo
.
getLongValue
(
"expires_in"
);
}
}
logger
.
error
(
"ticketTime"
+
ticketTime
+
"|"
+
ticket_expires_in
);
}
catch
(
Exception
e
)
{
logger
.
error
(
"微信公众号授权jsapiticket获取失败"
,
e
);
return
e
.
getMessage
();
...
...
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