fix(system/role): 修复角色菜单权限缓存未清理错误,优化角色菜单缓存逻辑

Closes #IBNENK
This commit is contained in:
2025-02-27 20:02:53 +08:00
parent 65941c1ee4
commit 0a62f81ad7
9 changed files with 50 additions and 47 deletions

View File

@@ -42,9 +42,9 @@ public class CacheConstants {
public static final String USER_KEY_PREFIX = "USER" + DELIMITER;
/**
* 菜单缓存键前缀
* 角色菜单缓存键前缀
*/
public static final String MENU_KEY_PREFIX = "MENU" + DELIMITER;
public static final String ROLE_MENU_KEY_PREFIX = "ROLE_MENU" + DELIMITER;
/**
* 字典缓存键前缀

View File

@@ -17,6 +17,7 @@
package top.continew.admin.common.context;
import lombok.Data;
import lombok.NoArgsConstructor;
import top.continew.admin.common.enums.DataScopeEnum;
import java.io.Serial;
@@ -29,6 +30,7 @@ import java.io.Serializable;
* @since 2023/3/7 22:08
*/
@Data
@NoArgsConstructor
public class RoleContext implements Serializable {
@Serial
@@ -48,4 +50,10 @@ public class RoleContext implements Serializable {
* 数据权限
*/
private DataScopeEnum dataScope;
public RoleContext(Long id, String code, DataScopeEnum dataScope) {
this.id = id;
this.code = code;
this.dataScope = dataScope;
}
}