一、RequestContextHolder,任意地方使用如下代码:
一、RequestContextHolder
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
二、注入的方式: