|
|
@@ -59,7 +59,7 @@ public class ResponseFilter implements GlobalFilter, Ordered {
|
|
|
|
|
|
ServerHttpRequest request = exchange.getRequest();
|
|
|
String path = request.getURI().getPath();
|
|
|
- if (!properties.getFilterUrl().isEmpty() && !properties.getFilterUrl().contains(path)) {
|
|
|
+ if (properties.getFilterUrl().isEmpty() || !properties.getFilterUrl().contains(path)) {
|
|
|
return chain.filter(exchange);
|
|
|
}
|
|
|
ServerHttpResponse originalResponse = exchange.getResponse();
|
|
|
@@ -106,10 +106,11 @@ public class ResponseFilter implements GlobalFilter, Ordered {
|
|
|
if (Objects.equals(status, CommonConstants.SUCCESS)) {
|
|
|
//获取请求token
|
|
|
List<String> tokens = exchange.getRequest().getHeaders().get(HttpHeaders.AUTHORIZATION);
|
|
|
- if(tokens != null){
|
|
|
- sendMsg(path, exchange.getAttribute("requestBody"), tokens.get(0));
|
|
|
+ Object attribute = exchange.getAttribute("requestBody");
|
|
|
+ if(tokens != null && !tokens.isEmpty()){
|
|
|
+ sendMsg(path, attribute, tokens.get(0));
|
|
|
}else{
|
|
|
- sendMsg(path, exchange.getAttribute("requestBody"), null);
|
|
|
+ sendMsg(path, attribute, null);
|
|
|
}
|
|
|
|
|
|
}
|
|
|
@@ -145,7 +146,7 @@ public class ResponseFilter implements GlobalFilter, Ordered {
|
|
|
return Integer.MIN_VALUE;
|
|
|
}
|
|
|
|
|
|
- private void sendMsg(String url, String param, String token) {
|
|
|
+ private void sendMsg(String url, Object param, String token) {
|
|
|
Object userId = null;
|
|
|
if(StrUtil.isNotBlank(token)){
|
|
|
if (token.startsWith("Bearer ")) {
|
|
|
@@ -159,9 +160,9 @@ public class ResponseFilter implements GlobalFilter, Ordered {
|
|
|
RabbitDtsMethodQueueMQ msg = RabbitDtsMethodQueueMQ.build(RabbitDtsMethodQueueMQ.MsgEntity.builder()
|
|
|
.url(url)
|
|
|
.userId(userId)
|
|
|
- .param(param)
|
|
|
+ .param(param != null ? param.toString() : "")
|
|
|
.build());
|
|
|
-// imqSender.send(msg);
|
|
|
+ imqSender.send(msg);
|
|
|
log.info("send msg success, msg={}", JSON.toJSONString(msg));
|
|
|
}
|
|
|
|