fix: 时间戳溢出导致时间失效修复

This commit is contained in:
张松
2024-12-24 16:59:55 +08:00
parent 24571a7c64
commit cb20edf097

View File

@@ -77,11 +77,11 @@ public class RedisServiceImpl implements RedisService {
String watchKey = RedisKeys.getFreeWatchKey(userId, false);
String payFreeWatchInfo = redisUtils.get(watchKey);
Integer expireTime = -1;
Long expireTime = -1L;
JSONObject jsonObject = null;
if (StrUtil.isNotBlank(payFreeWatchInfo)) {
jsonObject = JSONObject.parseObject(payFreeWatchInfo);
expireTime = jsonObject.getInteger("expireTime");
expireTime = jsonObject.getLong("expireTime");
}
if ((StrUtil.isNotBlank(permanentlyFreeWatch) && redisUtils.isExpiredSet(freeWatchKey)) || (StrUtil.isNotBlank(permanentlyFreeWatch) && DateUtil.current() >= expireTime)) {