|
|
@@ -49,9 +49,9 @@ public class GLDMasterService {
|
|
|
RedisUtils redisUtils;
|
|
|
|
|
|
public String getGetToken() throws Exception{
|
|
|
-// if (redisUtils.hasKey(RedisKeyEnum.KEY_CF_GLD_MASTER_GET_TOKEN.getValue())) {
|
|
|
-// return redisUtils.get(RedisKeyEnum.KEY_CF_GLD_MASTER_GET_TOKEN.getValue()).toString();
|
|
|
-// } else {
|
|
|
+ if (redisUtils.hasKey(RedisKeyEnum.KEY_CF_GLD_MASTER_GET_TOKEN.getValue())) {
|
|
|
+ return redisUtils.get(RedisKeyEnum.KEY_CF_GLD_MASTER_GET_TOKEN.getValue()).toString();
|
|
|
+ } else {
|
|
|
String url = masterHost + masterGetToken;
|
|
|
Map<String, String> header = new HashMap<>();
|
|
|
header.put("Authorization", masterAuthorization);
|
|
|
@@ -60,10 +60,10 @@ public class GLDMasterService {
|
|
|
String accessToken = object.getString("access_token");
|
|
|
Integer expiresIn = object.getInteger("expires_in");
|
|
|
if (StringUtil.isNotEmpty(accessToken) && StringUtil.isNotEmpty(expiresIn)) {
|
|
|
-// redisUtils.set(RedisKeyEnum.KEY_CF_GLD_MASTER_GET_TOKEN.getValue(), accessToken, expiresIn - 600, TimeUnit.SECONDS);
|
|
|
+ redisUtils.set(RedisKeyEnum.KEY_CF_GLD_MASTER_GET_TOKEN.getValue(), accessToken, expiresIn - 600, TimeUnit.SECONDS);
|
|
|
return accessToken;
|
|
|
}
|
|
|
-// }
|
|
|
+ }
|
|
|
return null;
|
|
|
}
|
|
|
|