Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
cloud-fb
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
王衍超
cloud-fb
Commits
73fa4c88
Commit
73fa4c88
authored
Apr 26, 2022
by
yanHeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[修改] 轨迹获取token
parent
b83bdf00
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
0 deletions
+9
-0
IotPlatformUtils.java
...in/java/com/beecode/inz/common/util/IotPlatformUtils.java
+9
-0
No files found.
backend/inz.common/src/main/java/com/beecode/inz/common/util/IotPlatformUtils.java
View file @
73fa4c88
...
...
@@ -92,6 +92,8 @@ public class IotPlatformUtils {
HashMap
<
String
,
Object
>
tokenMap
=
getAuthToken
(
CLIET_ID
,
CLIENT_SECRET
);
if
((
int
)
tokenMap
.
get
(
"status"
)
==
0
)
{
token
=
tokenMap
.
get
(
"data"
).
toString
();
}
else
{
return
null
;
}
}
List
<
Map
<
String
,
Object
>>
imeisInfos
=
new
ArrayList
<>();
...
...
@@ -175,6 +177,11 @@ public class IotPlatformUtils {
String
sendPost
=
HttpSendUtil
.
sendPost
(
TOKEN_URL
,
sendParam
,
StandardCharsets
.
UTF_8
.
name
());
JSONObject
postStr
=
new
JSONObject
(
sendPost
);
if
(
40000
==
postStr
.
getInt
(
"code"
)){
map
.
put
(
"status"
,
-
2
);
map
.
put
(
"message"
,
"获取IOT平台token失败"
);
return
map
;
}
String
accessToken
=
postStr
.
getString
(
"access_token"
);
if
(
accessToken
!=
null
)
{
RedisUtils
.
getInstance
().
set
(
getGpsWuLingTokenRedisKey
(
CLIET_ID
,
CLIENT_SECRET
),
accessToken
,
postStr
.
getInt
(
"expires_in"
)-
3
);
...
...
@@ -207,6 +214,8 @@ public class IotPlatformUtils {
HashMap
<
String
,
Object
>
tokenMap
=
getAuthToken
(
CLIET_ID
,
CLIENT_SECRET
);
if
((
int
)
tokenMap
.
get
(
"status"
)
==
0
)
{
token
=
tokenMap
.
get
(
"data"
).
toString
();
}
else
{
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