|
@@ -1,6 +1,7 @@
|
|
|
package cn.hanghui.outapi.platform.tenant.service.impl;
|
|
|
|
|
|
import cn.hanghui.outapi.platform.common.utils.DESUtil;
|
|
|
+import cn.hanghui.outapi.platform.common.utils.Preconditions;
|
|
|
import cn.hanghui.outapi.platform.tenant.entity.dto.RiskPcResp;
|
|
|
import cn.hanghui.outapi.platform.tenant.entity.enums.RiskRespCodeEnum;
|
|
|
import cn.hutool.http.HttpUtil;
|
|
@@ -80,7 +81,9 @@ public class RiskServer {
|
|
|
|
|
|
private String getFxpfjxToken() {
|
|
|
try {
|
|
|
- if (redisTemplate.hasKey(CACHE_TOKEN_FXPFJX_KEY)) {
|
|
|
+ if (redisTemplate.hasKey(CACHE_TOKEN_FXPFJX_KEY)
|
|
|
+ && Preconditions.isNotBlank(redisTemplate.opsForValue().get(CACHE_TOKEN_FXPFJX_KEY))
|
|
|
+ && Preconditions.isNotBlank((String) redisTemplate.opsForValue().get(CACHE_TOKEN_FXPFJX_KEY))) {
|
|
|
return (String) redisTemplate.opsForValue().get(CACHE_TOKEN_FXPFJX_KEY);
|
|
|
}
|
|
|
JSONObject object = new JSONObject();
|
|
@@ -94,7 +97,7 @@ public class RiskServer {
|
|
|
RiskPcResp riskPcResp = JSONObject.parseObject(resp, RiskPcResp.class);
|
|
|
if (RiskRespCodeEnum.SUCCESS.getCode().equals(riskPcResp.getHeader().getCode())) {
|
|
|
String token = riskPcResp.getBody().getToken();
|
|
|
- redisTemplate.opsForValue().set(CACHE_TOKEN_FXPFJX_KEY, token, 7100, TimeUnit.SECONDS);
|
|
|
+ redisTemplate.opsForValue().set(CACHE_TOKEN_FXPFJX_KEY, token, 6000, TimeUnit.SECONDS);
|
|
|
return token;
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
@@ -104,6 +107,4 @@ public class RiskServer {
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
-
|
|
|
}
|