增加token续期

master
bynt 3 years ago
parent c048af80aa
commit 543af053b6

@ -112,6 +112,7 @@ public class TokenProvider implements InitializingBean {
if (differ <= properties.getDetect()) {
long renew = time + properties.getRenew();
redisUtils.expire(properties.getOnlineKey() + token, renew, TimeUnit.MILLISECONDS);
redisUtils.expire(token, renew, TimeUnit.MILLISECONDS);
return true;
}
return false;

@ -19,7 +19,6 @@ import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.Date;
/**
@ -31,6 +30,7 @@ import java.util.Date;
@NoArgsConstructor
public class OnlineUserDto {
/**
*
*/

@ -49,6 +49,7 @@ public class OnlineUserService {
/**
* 线
*
* @param jwtUserDto /
* @param token /
* @param request /
@ -69,6 +70,7 @@ public class OnlineUserService {
/**
*
*
* @param filter /
* @param pageable /
* @return /
@ -83,6 +85,7 @@ public class OnlineUserService {
/**
*
*
* @param filter /
* @return /
*/
@ -106,6 +109,7 @@ public class OnlineUserService {
/**
*
*
* @param key /
*/
public void kickOut(String key) {
@ -115,6 +119,7 @@ public class OnlineUserService {
/**
* 退
*
* @param token /
*/
public void logout(String token) {
@ -124,6 +129,7 @@ public class OnlineUserService {
/**
*
*
* @param all /
* @param response /
* @throws IOException /
@ -145,6 +151,7 @@ public class OnlineUserService {
/**
*
*
* @param key /
* @return /
*/
@ -154,6 +161,7 @@ public class OnlineUserService {
/**
* 线
*
* @param userName
*/
public void checkLoginOnUser(String userName, String igoreToken) {
@ -179,6 +187,7 @@ public class OnlineUserService {
/**
* 退
*
* @param username /
*/
@Async

@ -135,6 +135,7 @@ public class WebSocketServer {
break;
case DefaultNumberConstants.FIVE_NUMBER:
Long userId = getUserId(session);
log.info("================= userId as {} ====================", userId);
if (userId != null) {
messageNotificationService.create
(message, userId);

Loading…
Cancel
Save