shiro获取当前用户信息

2019独角兽企业重金招聘Python工程师标准>>> hot3.png

public class SysUtils {

    public static User getUser(){
        Subject currentUser = SecurityUtils.getSubject();
        Session session = currentUser.getSession();
        User user = (User) session.getAttribute(Const.SESSION_USER);

        return user;
    }
}

转载于:https://my.oschina.net/u/2285090/blog/1819819

你可能感兴趣的:(shiro获取当前用户信息)