mirror of
https://github.com/zongzibinbin/MallChat.git
synced 2026-03-14 14:13:42 +08:00
代码优化
This commit is contained in:
@@ -80,7 +80,7 @@ public class JwtUtils {
|
||||
public Long getUidOrNull(String token) {
|
||||
return Optional.ofNullable(verifyToken(token))
|
||||
.map(map -> map.get(UID_CLAIM))
|
||||
.map(Claim::asLong)
|
||||
.map(Claim::asLong)
|
||||
.orElse(null);
|
||||
}
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ public class RedisUtils {
|
||||
|
||||
public static Long inc(String key, int time, TimeUnit unit) {
|
||||
RedisScript<Long> redisScript = new DefaultRedisScript<>(LUA_INCR_EXPIRE, Long.class);
|
||||
return stringRedisTemplate.execute(redisScript, Collections.singletonList(key), unit.toSeconds(time));
|
||||
return stringRedisTemplate.execute(redisScript, Collections.singletonList(key), String.valueOf(unit.toSeconds(time)));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user