mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2025-08-24 16:18:51 +08:00
优化代码
This commit is contained in:
parent
fe7a4705b7
commit
c887289518
@ -19,12 +19,16 @@ import java.io.File;
|
|||||||
*/
|
*/
|
||||||
public class WxCpJedisConfigStorage implements WxCpConfigStorage {
|
public class WxCpJedisConfigStorage implements WxCpConfigStorage {
|
||||||
|
|
||||||
/* Redis keys here */
|
/**
|
||||||
|
* Redis keys here
|
||||||
|
*/
|
||||||
private static final String ACCESS_TOKEN_KEY = "WX_CP_ACCESS_TOKEN";
|
private static final String ACCESS_TOKEN_KEY = "WX_CP_ACCESS_TOKEN";
|
||||||
private static final String ACCESS_TOKEN_EXPIRES_TIME_KEY = "WX_CP_ACCESS_TOKEN_EXPIRES_TIME";
|
private static final String ACCESS_TOKEN_EXPIRES_TIME_KEY = "WX_CP_ACCESS_TOKEN_EXPIRES_TIME";
|
||||||
private static final String JS_API_TICKET_KEY = "WX_CP_JS_API_TICKET";
|
private static final String JS_API_TICKET_KEY = "WX_CP_JS_API_TICKET";
|
||||||
private static final String JS_API_TICKET_EXPIRES_TIME_KEY = "WX_CP_JS_API_TICKET_EXPIRES_TIME";
|
private static final String JS_API_TICKET_EXPIRES_TIME_KEY = "WX_CP_JS_API_TICKET_EXPIRES_TIME";
|
||||||
/* Redis clients pool */
|
/**
|
||||||
|
* Redis clients pool
|
||||||
|
*/
|
||||||
private final JedisPool jedisPool;
|
private final JedisPool jedisPool;
|
||||||
private volatile String corpId;
|
private volatile String corpId;
|
||||||
private volatile String corpSecret;
|
private volatile String corpSecret;
|
||||||
@ -196,8 +200,7 @@ public class WxCpJedisConfigStorage implements WxCpConfigStorage {
|
|||||||
String expiresTimeStr = jedis.get(ACCESS_TOKEN_EXPIRES_TIME_KEY);
|
String expiresTimeStr = jedis.get(ACCESS_TOKEN_EXPIRES_TIME_KEY);
|
||||||
|
|
||||||
if (expiresTimeStr != null) {
|
if (expiresTimeStr != null) {
|
||||||
Long expiresTime = Long.parseLong(expiresTimeStr);
|
return Long.parseLong(expiresTimeStr);
|
||||||
return expiresTime;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0L;
|
return 0L;
|
||||||
|
Loading…
Reference in New Issue
Block a user