|
|
|
@ -16,6 +16,7 @@ import javax.servlet.http.HttpServletRequest;
|
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
import java.util.HashMap;
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
import java.util.Objects;
|
|
|
|
|
import java.util.concurrent.ConcurrentHashMap;
|
|
|
|
|
|
|
|
|
|
@Slf4j
|
|
|
|
@ -69,6 +70,10 @@ public class JwtInterceptor implements HandlerInterceptor {
|
|
|
|
|
private void checkSingleLogin(JWT currentJwt) {
|
|
|
|
|
Object id = currentJwt.getPayload("id");
|
|
|
|
|
JWT singleLoginTokenCache = singleLoginTokenCacheMap.get(id);
|
|
|
|
|
if (Objects.isNull(singleLoginTokenCache)){
|
|
|
|
|
singleLoginTokenCacheMap.put(id, currentJwt);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
// 然后将当前的expireTime和singleLoginTokenCache进行比较
|
|
|
|
|
Object expireTime = singleLoginTokenCache.getPayload("expireTime");
|
|
|
|
|
long singleLoginTokenCacheExpireTime = Long.parseLong(String.valueOf(expireTime));
|
|
|
|
|