Spring Web 中获取 HTTP 请求参数的方法
Spring Web 中获取 HTTP 请求参数的方法
RequestAttributes requestAttributes = RequestContextHolder.getRequestAttributes(); ServletRequestAttributes servletRequestAttributes = (ServletRequestAttributes) requestAttributes; if (servletRequestAttributes == null) { log.error("请求参数为空!"); throw new BusinessException("请求参数为空!"); } HttpServletRequest httpServletRequest = servletRequestAttributes.getRequest(); String apiSign = httpServletRequest.getParameter("apiSign");

浙公网安备 33010602011771号