tanghc 6 years ago
parent 99d90d60cc
commit 5645d01765
  1. 7
      sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/bean/ApiConfig.java
  2. 4
      sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/zuul/configuration/BaseZuulConfiguration.java
  3. 2
      sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/zuul/configuration/ZuulErrorController.java

@ -15,7 +15,7 @@ import com.gitee.sop.gatewaycommon.validate.ApiValidator;
import com.gitee.sop.gatewaycommon.validate.Encrypter;
import com.gitee.sop.gatewaycommon.validate.Signer;
import com.gitee.sop.gatewaycommon.validate.Validator;
import com.gitee.sop.gatewaycommon.zuul.configuration.BaseZuulController;
import com.gitee.sop.gatewaycommon.zuul.configuration.ZuulErrorController;
import com.gitee.sop.gatewaycommon.zuul.param.ZuulParamBuilder;
import com.gitee.sop.gatewaycommon.zuul.result.ZuulResultExecutor;
import com.netflix.zuul.context.RequestContext;
@ -82,7 +82,10 @@ public class ApiConfig {
*/
private SessionManager sessionManager = new ApiSessionManager();
private BaseZuulController baseZuulController = new BaseZuulController();
/**
* zuul网关全局异常处理
*/
private ZuulErrorController zuulErrorController = new ZuulErrorController();
/**
* 错误模块

@ -76,8 +76,8 @@ public class BaseZuulConfiguration {
}
@Bean
BaseZuulController baseZuulController() {
return ApiContext.getApiConfig().getBaseZuulController();
ZuulErrorController baseZuulController() {
return ApiContext.getApiConfig().getZuulErrorController();
}
@PostConstruct

@ -16,7 +16,7 @@ import org.springframework.web.bind.annotation.ResponseBody;
*/
@Controller
@Slf4j
public class BaseZuulController implements ErrorController {
public class ZuulErrorController implements ErrorController {
public static final String ERROR_PATH = "/error";
Loading…
Cancel
Save