diff --git a/sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/zuul/ValidateService.java b/sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/zuul/ValidateService.java index 3ad55621..46632c89 100644 --- a/sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/zuul/ValidateService.java +++ b/sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/zuul/ValidateService.java @@ -37,7 +37,10 @@ public class ValidateService { RequestContext currentContext = RequestContext.getCurrentContext(); currentContext.setRequest(RequestUtil.wrapRequest(request)); currentContext.setResponse(response); - doValidate(currentContext, callback); + // 解析参数 + ApiParam param = paramBuilder.build(currentContext); + ZuulContext.setApiParam(param); + doValidate(currentContext, param, callback); } /** @@ -45,10 +48,7 @@ public class ValidateService { * * @param currentContext currentContext */ - private void doValidate(RequestContext currentContext, ValidateCallback callback) { - // 解析参数 - ApiParam param = paramBuilder.build(currentContext); - ZuulContext.setApiParam(param); + private void doValidate(RequestContext currentContext, ApiParam param, ValidateCallback callback) { Exception error = null; // 验证操作,这里有负责验证签名参数 try {