shiro獲取當前用戶信息

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;
    }
}
相關文章
相關標籤/搜索