Commit 78333db5 authored by 赵啸非's avatar 赵啸非

添加用户查询列表

parent 21cc7cbf
...@@ -14,7 +14,7 @@ import reactor.core.publisher.Mono; ...@@ -14,7 +14,7 @@ import reactor.core.publisher.Mono;
* @author: zxfei * @author: zxfei
* @date: 2022/6/20 16:57 * @date: 2022/6/20 16:57
*/ */
@Component //@Component
public class ForwardAuthFilter implements GlobalFilter { public class ForwardAuthFilter implements GlobalFilter {
@Override @Override
public Mono<Void> filter(ServerWebExchange exchange, GatewayFilterChain chain) { public Mono<Void> filter(ServerWebExchange exchange, GatewayFilterChain chain) {
......
package com.mortals.xhx.base.framework.handler; //package com.mortals.xhx.base.framework.handler;
//
import com.mortals.xhx.common.utils.WebFluxUtils; //import com.mortals.xhx.common.utils.WebFluxUtils;
import org.springframework.web.reactive.function.server.ServerResponse; //import org.springframework.web.reactive.function.server.ServerResponse;
import org.springframework.web.server.ServerWebExchange; //import org.springframework.web.server.ServerWebExchange;
import org.springframework.web.server.WebExceptionHandler; //import org.springframework.web.server.WebExceptionHandler;
import reactor.core.publisher.Mono; //import reactor.core.publisher.Mono;
//
/** ///**
* 自定义限流异常处理 // * 自定义限流异常处理
* // *
* @author: zxfei // * @author: zxfei
* @date: 2022/6/20 13:53 // * @date: 2022/6/20 13:53
*/ // */
public class SentinelFallbackHandler implements WebExceptionHandler { //public class SentinelFallbackHandler implements WebExceptionHandler {
private Mono<Void> writeResponse(ServerResponse response, ServerWebExchange exchange) { // private Mono<Void> writeResponse(ServerResponse response, ServerWebExchange exchange) {
return WebFluxUtils.webFluxResponseWriter(exchange.getResponse(), "请求超过最大数,请稍候再试"); // return WebFluxUtils.webFluxResponseWriter(exchange.getResponse(), "请求超过最大数,请稍候再试");
} // }
//
@Override // @Override
public Mono<Void> handle(ServerWebExchange exchange, Throwable ex) { // public Mono<Void> handle(ServerWebExchange exchange, Throwable ex) {
ex.printStackTrace(); // ex.printStackTrace();
if (exchange.getResponse().isCommitted()) { // if (exchange.getResponse().isCommitted()) {
return Mono.error(ex); // return Mono.error(ex);
} // }
return null; // return null;
/* if (!BlockException.isBlockException(ex)) { ///* if (!BlockException.isBlockException(ex)) {
return Mono.error(ex); // return Mono.error(ex);
} // }
return handleBlockedRequest(exchange, ex).flatMap(response -> writeResponse(response, exchange));*/ // return handleBlockedRequest(exchange, ex).flatMap(response -> writeResponse(response, exchange));*/
} // }
//
/* private Mono<ServerResponse> handleBlockedRequest(ServerWebExchange exchange, Throwable throwable) { ///* private Mono<ServerResponse> handleBlockedRequest(ServerWebExchange exchange, Throwable throwable) {
return GatewayCallbackManager.getBlockHandler().handleRequest(exchange, throwable); // return GatewayCallbackManager.getBlockHandler().handleRequest(exchange, throwable);
}*/ // }*/
} //}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment