Shiro controller中获取当前登录用户信息
Posted gzhbk
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Shiro controller中获取当前登录用户信息相关的知识,希望对你有一定的参考价值。
@RequestMapping(value = "/competitorPageList" )
public String competitorPageList(Model model, ) {
Long currentUserId = (Long) SecurityUtils.getSubject().getSession().getAttribute("currentUserId");
}
1
2
3
4
5
方式二:
@RequestMapping(value = "/competitorPageList" )
public String competitorPageList(Model model,HttpServletRequest request ) {
Long currentUserId = (Long) request.getSession().getAttribute("currentUserId");
}
————————————————
版权声明:本文为CSDN博主「fengcai0123」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/fengcai0123/article/details/75235861
以上是关于Shiro controller中获取当前登录用户信息的主要内容,如果未能解决你的问题,请参考以下文章