Shiro(3) 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

posted @ 2020-04-24 14:17  A汉克先生  阅读(5315)  评论(0编辑  收藏  举报