入门客AI创业平台(我带你入门,你带我飞行)
博文笔记

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

创建时间:2017-07-17 投稿人: 浏览次数:12565

//Shiro controller中获取当前登录用户信息

方式一:

    @RequestMapping(value = "/competitorPageList" ) 
    public String competitorPageList(Model model, ) {

 Long currentUserId = (Long) SecurityUtils.getSubject().getSession().getAttribute("currentUserId"); 
 }

方式二:

 @RequestMapping(value = "/competitorPageList" ) 
    public String competitorPageList(Model model,HttpServletRequest request ) { 
Long currentUserId = (Long) request.getSession().getAttribute("currentUserId");
       }
声明:该文观点仅代表作者本人,入门客AI创业平台信息发布平台仅提供信息存储空间服务,如有疑问请联系rumenke@qq.com。