|
@@ -63,7 +63,8 @@ public class DecryptRequestionBodyFilter extends JedisUtil implements GlobalFilt
|
63
|
63
|
throw new GatewayException(1, "验证失败,请刷新重试");
|
64
|
64
|
}
|
65
|
65
|
Mono<Void> voidMono;
|
66
|
|
- if (!decrypt.equals("true")) {
|
|
66
|
+ if (!"true".equals(decrypt)) {
|
|
67
|
+ //白名单中的接口
|
67
|
68
|
voidMono = returnMononew(chain, exchange);
|
68
|
69
|
}else{
|
69
|
70
|
voidMono = readBody(exchange, chain);
|
|
@@ -76,28 +77,12 @@ public class DecryptRequestionBodyFilter extends JedisUtil implements GlobalFilt
|
76
|
77
|
String userid = ApiUtil.listToStr(headers.get("Xh-User-Id"));
|
77
|
78
|
if (ApiUtil.isEmpty(token) || !token.equals(redis_token)
|
78
|
79
|
|| ApiUtil.isEmpty(key) || !key.split("_")[1].equals(userid)) {
|
79
|
|
- //GatewayException throwable = new GatewayException(2, "登录失效");
|
80
|
|
- //return Mono.error(throwable);
|
81
|
80
|
throw new GatewayException(2, "登录失效");
|
82
|
81
|
} else {
|
83
|
82
|
refreshToken(key, redis_token);//刷新token
|
84
|
83
|
}
|
85
|
84
|
}
|
86
|
85
|
return voidMono;
|
87
|
|
-
|
88
|
|
-// // 登录跳过网关验证,检查白名单(配置)最好把不拦截路径放入配置文件,此处通过正则
|
89
|
|
-// if(antPathMatcher.match("/**/api/login/auth/**",path)){
|
90
|
|
-// return readBody(exchange, chain);
|
91
|
|
-// }
|
92
|
|
-// // 处理参数
|
93
|
|
-// MediaType contentType = headers.getContentType();
|
94
|
|
-// long contentLength = headers.getContentLength();
|
95
|
|
-// if (contentLength > 0) {
|
96
|
|
-// if (MediaType.APPLICATION_JSON.equals(contentType) || MediaType.APPLICATION_JSON_UTF8.equals(contentType)) {
|
97
|
|
-// return readBody(exchange, chain);
|
98
|
|
-// }
|
99
|
|
-// }
|
100
|
|
-// return chain.filter(exchange);
|
101
|
86
|
}
|
102
|
87
|
|
103
|
88
|
ServerHttpRequestDecorator decorate(ServerWebExchange exchange, HttpHeaders headers, CachedBodyOutputMessage outputMessage) {
|