Merge branch 'master-jdk17' of https://gitee.com/zhijiantianya/yudao-cloud
commit
7edcebf51f
|
@ -19,6 +19,7 @@ import org.springframework.http.HttpMethod;
|
||||||
import org.springframework.web.method.HandlerMethod;
|
import org.springframework.web.method.HandlerMethod;
|
||||||
import org.springframework.web.servlet.HandlerExecutionChain;
|
import org.springframework.web.servlet.HandlerExecutionChain;
|
||||||
import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping;
|
import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping;
|
||||||
|
import org.springframework.web.util.ServletRequestPathUtils;
|
||||||
|
|
||||||
import javax.servlet.FilterChain;
|
import javax.servlet.FilterChain;
|
||||||
import javax.servlet.ServletException;
|
import javax.servlet.ServletException;
|
||||||
|
@ -131,6 +132,12 @@ public class ApiEncryptFilter extends ApiRequestFilter {
|
||||||
@SuppressWarnings("PatternVariableCanBeUsed")
|
@SuppressWarnings("PatternVariableCanBeUsed")
|
||||||
private ApiEncrypt getApiEncrypt(HttpServletRequest request) {
|
private ApiEncrypt getApiEncrypt(HttpServletRequest request) {
|
||||||
try {
|
try {
|
||||||
|
// 特殊:兼容 SpringBoot 2.X 版本会报错的问题 https://t.zsxq.com/kqyiB
|
||||||
|
if (!ServletRequestPathUtils.hasParsedRequestPath(request)) {
|
||||||
|
ServletRequestPathUtils.parseAndCache(request);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 解析 @ApiEncrypt 注解
|
||||||
HandlerExecutionChain mappingHandler = requestMappingHandlerMapping.getHandler(request);
|
HandlerExecutionChain mappingHandler = requestMappingHandlerMapping.getHandler(request);
|
||||||
if (mappingHandler == null) {
|
if (mappingHandler == null) {
|
||||||
return null;
|
return null;
|
||||||
|
|
Loading…
Reference in New Issue