Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
map-parent
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
常超
map-parent
Commits
fb4d8938
Commit
fb4d8938
authored
Mar 19, 2021
by
YANGYANG
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tokenutils类中获取方式修改 改为读取common_utils resources下文件
parent
2eeeeb74
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
7 additions
and
30 deletions
+7
-30
common/common_utils/src/main/java/com/founder/commonutils/util/PropertieUtil.java
+1
-1
common/common_utils/src/main/java/com/founder/commonutils/util/TokenUtils.java
+2
-16
common/common_utils/src/main/resources/token.properties
+4
-1
serviceapi/imageapi/src/main/resources/application-dev.properties
+0
-6
serviceapi/imageapi/src/main/resources/application-prod.properties
+0
-6
No files found.
common/common_utils/src/main/java/com/founder/commonutils/util/PropertieUtil.java
View file @
fb4d8938
...
...
@@ -16,7 +16,7 @@ public class PropertieUtil {
String
value
=
""
;
try
{
Properties
prop
=
new
Properties
();
FileInputStream
fileInputStream
=
new
FileInput
Stream
(
url
);
InputStream
fileInputStream
=
PropertieUtil
.
class
.
getResourceAs
Stream
(
url
);
prop
.
load
(
fileInputStream
);
value
=
prop
.
getProperty
(
key
);
fileInputStream
.
close
();
...
...
common/common_utils/src/main/java/com/founder/commonutils/util/TokenUtils.java
View file @
fb4d8938
...
...
@@ -33,21 +33,7 @@ import java.util.*;
public
class
TokenUtils
{
private
static
Log
logger
=
LogFactory
.
getLog
(
HttpClient
.
class
);
private
static
RequestConfig
requestConfig
=
null
;
private
static
String
tokenPath
=
""
;
private
static
String
yt_tokenUrl
=
""
;
/**
* 静态属性注册配置文件中的值
* @param tokenPath
*/
@Value
(
"${tokenPath}"
)
void
setTokenPath
(
String
tokenPath
){
this
.
tokenPath
=
tokenPath
;
}
@Value
(
"${token_url}"
)
void
setYtgs_tokenUrl
(
String
yt_tokenUrl
)
{
this
.
yt_tokenUrl
=
yt_tokenUrl
;
}
private
static
String
tokenPath
=
"/token.properties"
;
static
{
// 设置请求和传输超时时间
...
...
@@ -110,7 +96,7 @@ public class TokenUtils {
object
.
put
(
"scope"
,
scope
);
object
.
put
(
"client_secret"
,
client_secret
);
object
.
put
(
"client_id"
,
client_id
);
String
token_url
=
yt_tokenUrl
;
String
token_url
=
PropertieUtil
.
readTokenValue
(
"token_url"
,
tokenPath
)
;
try
{
String
resultString
=
doPostUrlEncodedFormEntity
(
token_url
,
headerMap
,
JSONObject
.
toJSONString
(
object
));
if
(!
StringUtils
.
isEmpty
(
resultString
))
{
...
...
serviceapi/imageapi
/src/main/resources/token.properties
→
common/common_utils
/src/main/resources/token.properties
View file @
fb4d8938
####################\u4E91\u5929\u839E\u5F0F\u8BF7\u6C42token\u914D\u7F6E\u53C2\u6570##\u5F00\u59CB#################
####################云天请求token配置参数##开始#################
token_url
=
http://26.3.12.56:8083/api/oauth/token
#header
Authorization
=
Basic Y2xpZW50YXBwOjEyMzQ1Ng==
Content-Type
=
application/x-www-form-urlencoded
...
...
@@ -13,4 +14,6 @@ client_id=clientapp
token
=
#\u8FC7\u671F\u65F6\u95F4
expiration
=
####################云天请求token配置参数##结束#################
serviceapi/imageapi/src/main/resources/application-dev.properties
View file @
fb4d8938
...
...
@@ -3,8 +3,3 @@ spring.datasource.driver-class-name=oracle.jdbc.driver.OracleDriver
spring.datasource.url
=
jdbc:oracle:thin:@47.92.129.99:1600:orcl
spring.datasource.username
=
XZXT
spring.datasource.password
=
XZXT
####################云天请求token配置参数##开始#################
token_url
=
http://26.3.12.56:8083/api/oauth/token
tokenPath
=
G:
\\
token
\\
token.properties
####################云天请求token配置参数##结束#################
\ No newline at end of file
serviceapi/imageapi/src/main/resources/application-prod.properties
View file @
fb4d8938
...
...
@@ -3,8 +3,3 @@ spring.datasource.driver-class-name=oracle.jdbc.driver.OracleDriver
spring.datasource.url
=
jdbc:oracle:thin:@10.100.17.120:1521:XZXT
spring.datasource.username
=
XZXT
spring.datasource.password
=
XzxtPwd#15
####################云天请求token配置参数##开始#################
token_url
=
http://26.3.12.56:8083/api/oauth/token
tokenPath
=
/data/software/token/token.properties
####################云天请求token配置参数##结束#################
\ No newline at end of file
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