Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
commons
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
3
Merge Requests
3
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DevOps
commons
Commits
5793523c
Commit
5793523c
authored
Mar 02, 2020
by
杨锐
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
获取令牌协议修改,Method。
parent
e921b4c7
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletion
+2
-1
TokenJob.java
.../src/main/java/cn/quantgroup/tech/brave/job/TokenJob.java
+2
-1
No files found.
brave-spring-boot-starter/src/main/java/cn/quantgroup/tech/brave/job/TokenJob.java
View file @
5793523c
...
...
@@ -10,6 +10,7 @@ import org.springframework.beans.factory.annotation.Value;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.http.HttpEntity
;
import
org.springframework.http.HttpHeaders
;
import
org.springframework.http.HttpMethod
;
import
org.springframework.scheduling.annotation.EnableScheduling
;
import
org.springframework.scheduling.annotation.Scheduled
;
import
org.springframework.web.client.RestTemplate
;
...
...
@@ -55,7 +56,7 @@ public class TokenJob {
HttpHeaders
requestHeaders
=
new
HttpHeaders
();
requestHeaders
.
add
(
CREDENTIAL
,
base64ForCredential
());
HttpEntity
<
Map
<
String
,
Object
>>
httpEntity
=
new
HttpEntity
<>(
requestHeaders
);
TokenResp
tokenResp
=
restTemplate
().
postForObject
(
tokenUrl
,
httpEntity
,
TokenResp
.
class
);
TokenResp
tokenResp
=
restTemplate
().
exchange
(
tokenUrl
,
HttpMethod
.
GET
,
httpEntity
,
TokenResp
.
class
).
getBody
(
);
log
.
info
(
"getToken tokenResp = 【{}】"
,
tokenResp
);
boolean
tokenValid
=
tokenResp
!=
null
&&
SUCCESS
==
tokenResp
.
getCode
()
&&
StringUtils
.
isNotBlank
(
tokenResp
.
getToken
());
if
(
tokenValid
)
{
...
...
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