Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
open-source
/
glsx-rest-admin-job-archetype
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit c3d1e8ad
authored
Apr 19, 2021
by
111-PC\111
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
[+]代码整理
1 parent
7e350053
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
0 deletions
glsx-rest-admin-job/src/main/java/cn/com/glsx/modules/model/param/AccessToken.java
glsx-rest-admin-job/src/main/java/cn/com/glsx/smartdevice/job/GetTokenJob.java
glsx-rest-admin-job/src/main/java/cn/com/glsx/modules/model/param/AccessToken.java
View file @
c3d1e8a
...
@@ -15,4 +15,14 @@ public class AccessToken implements Serializable {
...
@@ -15,4 +15,14 @@ public class AccessToken implements Serializable {
private
Long
expire_time
;
private
Long
expire_time
;
private
String
refresh_token
;
private
String
refresh_token
;
private
String
uid
;
private
String
uid
;
@Override
public
String
toString
()
{
return
"AccessToken{"
+
"access_token='"
+
access_token
+
'\''
+
", expire_time="
+
expire_time
+
", refresh_token='"
+
refresh_token
+
'\''
+
", uid='"
+
uid
+
'\''
+
'}'
;
}
}
}
glsx-rest-admin-job/src/main/java/cn/com/glsx/smartdevice/job/GetTokenJob.java
View file @
c3d1e8a
...
@@ -46,6 +46,7 @@ public class GetTokenJob implements SimpleJob {
...
@@ -46,6 +46,7 @@ public class GetTokenJob implements SimpleJob {
@Override
@Override
public
void
execute
(
ShardingContext
shardingContext
)
{
public
void
execute
(
ShardingContext
shardingContext
)
{
AccessToken
accessToken
=
accessTokenRedis
.
readCache
(
Constants
.
ACCESSTOKEN_REDISKEY
);
AccessToken
accessToken
=
accessTokenRedis
.
readCache
(
Constants
.
ACCESSTOKEN_REDISKEY
);
log
.
info
(
"redis查询出{}"
,
accessToken
);
if
(
null
!=
accessToken
)
{
if
(
null
!=
accessToken
)
{
if
((
System
.
currentTimeMillis
()-
accessToken
.
getExpire_time
())
>=
1000
*
60
*
60
*
2
)
{
if
((
System
.
currentTimeMillis
()-
accessToken
.
getExpire_time
())
>=
1000
*
60
*
60
*
2
)
{
ResponseBody
responseBody
=
sendRequestGetOA
(
tokenFlashUrl
+
accessToken
.
getRefresh_token
());
ResponseBody
responseBody
=
sendRequestGetOA
(
tokenFlashUrl
+
accessToken
.
getRefresh_token
());
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment