码迷,mamicode.com
首页 > 其他好文 > 详细

Shiro(3) controller中获取当前登录用户信息

时间:2020-04-24 14:41:05      阅读:270      评论:0      收藏:0      [点我收藏+]

标签:ash   long   session   blog   mode   mod   原创文章   das   str   

@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(3) controller中获取当前登录用户信息

标签:ash   long   session   blog   mode   mod   原创文章   das   str   

原文地址:https://www.cnblogs.com/gzhbk/p/12767165.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!