Shiro(3) controller中获取当前登录用户信息
//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。
- 上一篇: java 解析Json对象(嵌套json数组)
- 下一篇:没有了
