//获取到当前线程绑定的请求对象
HttpServletRequest request = ((ServletRequestAttributes)RequestContextHolder.getRequestAttributes()).getRequest();
//已经拿到session,就可以拿到session中保存的用户信息了。
System.out.println(request.getSession().getAttribute("userInfo"));
//获取到当前线程绑定的请求对象
HttpServletRequest request = ((ServletRequestAttributes)RequestContextHolder.getRequestAttributes()).getRequest();
//已经拿到session,就可以拿到session中保存的用户信息了。
System.out.println(request.getSession().getAttribute("userInfo"));