fix 修复 关闭租户后 在线用户token解析异常问题

This commit is contained in:
疯狂的狮子li 2023-04-20 12:59:38 +08:00
parent bec7f8c802
commit a345bcc0a0
2 changed files with 1 additions and 6 deletions

View File

@ -12,11 +12,6 @@ public interface GlobalConstants {
*/
String GLOBAL_REDIS_KEY = "global:";
/**
* 登录用户 redis key
*/
String LOGIN_TOKEN_KEY = GLOBAL_REDIS_KEY + "Authorization:login:token:";
/**
* 验证码 redis key
*/

View File

@ -46,7 +46,7 @@ public class SysUserOnlineController extends BaseController {
List<String> keys = StpUtil.searchTokenValue("", 0, -1, false);
List<UserOnlineDTO> userOnlineDTOList = new ArrayList<>();
for (String key : keys) {
String token = key.replace(GlobalConstants.LOGIN_TOKEN_KEY, "");
String token = StringUtils.substringAfterLast(key, ":");
// 如果已经过期则跳过
if (StpUtil.stpLogic.getTokenActivityTimeoutByToken(token) < -1) {
continue;