【sa-token】shiro替换为sa-token,核心架构修改点

This commit is contained in:
JEECG
2025-10-16 11:14:53 +08:00
parent 468af57489
commit c7c31e0945
31 changed files with 1313 additions and 1394 deletions

View File

@ -1,30 +0,0 @@
package org.jeecg.config.init;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.constant.CommonConstant;
import org.jeecg.common.util.RedisUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;
/**
* Shiro缓存清理
* 在应用启动时清除所有的Shiro授权缓存
* 主要用于解决重启项目,用户未重新登录,按钮权限不生效的问题
*/
@Slf4j
@Component
public class ShiroCacheClearRunner implements ApplicationRunner {
@Autowired
private RedisUtil redisUtil;
@Override
public void run(ApplicationArguments args) {
// 清空所有授权redis缓存
log.info("——— Service restart, clearing all user shiro authorization cache ——— ");
redisUtil.removeAll(CommonConstant.PREFIX_USER_SHIRO_CACHE);
}
}