SpringBoot_集成Shiro后获取当前用户


//SecurityUtils.getSubject().getPrincipal();  就可以获取了


protected User getCurrentUser(){
return (User) SecurityUtils.getSubject().getPrincipal();
}
原文地址:https://www.cnblogs.com/Amos-Turing/p/8725165.html