| | |
| | | import org.dromara.common.encrypt.annotation.ApiEncrypt; |
| | | import org.dromara.common.encrypt.properties.ApiDecryptProperties; |
| | | import org.springframework.http.HttpMethod; |
| | | import org.springframework.http.MediaType; |
| | | import org.springframework.web.method.HandlerMethod; |
| | | import org.springframework.web.servlet.HandlerExceptionResolver; |
| | | import org.springframework.web.servlet.HandlerExecutionChain; |
| | |
| | | ServletResponse responseWrapper = null; |
| | | EncryptResponseBodyWrapper responseBodyWrapper = null; |
| | | |
| | | // 是否为 json 请求 |
| | | if (StringUtils.startsWithIgnoreCase(request.getContentType(), MediaType.APPLICATION_JSON_VALUE)) { |
| | | // 是否为 put 或者 post 请求 |
| | | if (HttpMethod.PUT.matches(servletRequest.getMethod()) || HttpMethod.POST.matches(servletRequest.getMethod())) { |
| | | // 是否存在加密标头 |
| | |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | // 判断是否响应加密 |
| | | if (responseFlag) { |
| | | responseBodyWrapper = new EncryptResponseBodyWrapper(servletResponse); |