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

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

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