...
|
...
|
@@ -64,8 +64,11 @@ public class WrapperResponseGlobalFilter implements GlobalFilter, Ordered { |
|
|
return exchange.getResponse().setComplete();
|
|
|
}
|
|
|
|
|
|
ServerHttpResponse response = exchange.getResponse();
|
|
|
DataBufferFactory bufferFactory = response.bufferFactory();
|
|
|
// ServerHttpResponse response = exchange.getResponse();
|
|
|
// DataBufferFactory bufferFactory = response.bufferFactory();
|
|
|
|
|
|
|
|
|
//----------------------------------old
|
|
|
// ServerHttpResponseDecorator decorator = new ServerHttpResponseDecorator(response) {
|
|
|
// @Override
|
|
|
// public Mono<Void> writeWith(Publisher<? extends DataBuffer> body) {
|
...
|
...
|
@@ -93,18 +96,22 @@ public class WrapperResponseGlobalFilter implements GlobalFilter, Ordered { |
|
|
// return super.writeWith(body);
|
|
|
// }
|
|
|
// };
|
|
|
|
|
|
ServerHttpResponseDecorator decoratedResponse= new UTF8ServerHttpResponseDecorator(response);
|
|
|
if (DEFAULT_SYSTEM.equals(systemInfo)){
|
|
|
decoratedResponse= new UTF8ServerHttpResponseDecorator(response);
|
|
|
}else {
|
|
|
decoratedResponse= new GBKServerHttpResponseDecorator(response);
|
|
|
}
|
|
|
//----------------------------------old
|
|
|
|
|
|
/**
|
|
|
* 取消返回数据的修改
|
|
|
*/
|
|
|
// ServerHttpResponseDecorator decoratedResponse= new UTF8ServerHttpResponseDecorator(response);
|
|
|
// if (DEFAULT_SYSTEM.equals(systemInfo)){
|
|
|
// decoratedResponse= new UTF8ServerHttpResponseDecorator(response);
|
|
|
// }else {
|
|
|
// decoratedResponse= new GBKServerHttpResponseDecorator(response);
|
|
|
// }
|
|
|
//
|
|
|
|
|
|
return chain.filter(exchange.mutate().response(decoratedResponse).build());
|
|
|
//
|
|
|
// return chain.filter(exchange);
|
|
|
// return chain.filter(exchange.mutate().response(decoratedResponse).build());
|
|
|
|
|
|
return chain.filter(exchange);
|
|
|
}
|
|
|
|
|
|
@Override
|
...
|
...
|
|