update 优化冗余分隔符
This commit is contained in:
+1
-1
@@ -48,7 +48,7 @@ public class SysUserOnlineController extends BaseController {
|
||||
// 获取所有未过期的 token
|
||||
Collection<String> keys = RedisUtils.keys(CacheNames.ONLINE_TOKEN_KEY + "*");
|
||||
List<Supplier<UserOnlineDTO>> suppliers = keys.stream().map(key -> (Supplier<UserOnlineDTO>) () -> {
|
||||
String token = StringUtils.substringAfterLast(key, ":");
|
||||
String token = StringUtils.substringAfterLast(key, StringUtils.COLON);
|
||||
// 如果已经过期则跳过
|
||||
if (StpUtil.stpLogic.getTokenActiveTimeoutByToken(token) < -1) {
|
||||
return null;
|
||||
|
||||
@@ -10,6 +10,7 @@ import org.dromara.common.core.constant.SystemConstants;
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@@ -24,6 +25,8 @@ import java.util.List;
|
||||
@TableName("sys_menu")
|
||||
public class SysMenu extends BaseEntity {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 6967394714839655267L;
|
||||
/**
|
||||
* 菜单ID
|
||||
*/
|
||||
@@ -145,7 +148,7 @@ public class SysMenu extends BaseEntity {
|
||||
}
|
||||
// 非外链并且是一级目录(类型为目录)
|
||||
if (Constants.TOP_PARENT_ID.equals(getParentId()) && SystemConstants.TYPE_DIR.equals(getMenuType())
|
||||
&& SystemConstants.NO.equals(getIsFrame())) {
|
||||
&& SystemConstants.NO.equals(getIsFrame())) {
|
||||
routerPath = "/" + this.path;
|
||||
}
|
||||
// 非外链并且是一级目录(类型为菜单)
|
||||
@@ -195,7 +198,7 @@ public class SysMenu extends BaseEntity {
|
||||
* 内链域名特殊字符替换
|
||||
*/
|
||||
public static String innerLinkReplaceEach(String path) {
|
||||
return StringUtils.replaceEach(path, new String[]{Constants.HTTP, Constants.HTTPS, Constants.WWW, ".", ":"},
|
||||
new String[]{"", "", "", "/", "/"});
|
||||
return StringUtils.replaceEach(path, new String[]{Constants.HTTP, Constants.HTTPS, Constants.WWW, ".", StringUtils.COLON},
|
||||
new String[]{"", "", "", "/", "/"});
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -546,7 +546,7 @@ public class SysRoleServiceImpl implements ISysRoleService, RoleService {
|
||||
}
|
||||
// 角色关联的在线用户量过大会导致redis阻塞卡顿 谨慎操作
|
||||
keys.parallelStream().forEach(key -> {
|
||||
String token = StringUtils.substringAfterLast(key, ":");
|
||||
String token = StringUtils.substringAfterLast(key, StringUtils.COLON);
|
||||
// 如果已经过期则跳过
|
||||
if (StpUtil.stpLogic.getTokenActiveTimeoutByToken(token) < -1) {
|
||||
return;
|
||||
@@ -582,7 +582,7 @@ public class SysRoleServiceImpl implements ISysRoleService, RoleService {
|
||||
}
|
||||
// 角色关联的在线用户量过大会导致redis阻塞卡顿 谨慎操作
|
||||
keys.parallelStream().forEach(key -> {
|
||||
String token = StringUtils.substringAfterLast(key, ":");
|
||||
String token = StringUtils.substringAfterLast(key, StringUtils.COLON);
|
||||
// 如果已经过期则跳过
|
||||
if (StpUtil.stpLogic.getTokenActiveTimeoutByToken(token) < -1) {
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user