Commit 3aac0aa2 authored by hezhen's avatar hezhen

修改网关

parent 919c1a28
...@@ -72,7 +72,8 @@ public class AccessGatewayFilter implements GlobalFilter { ...@@ -72,7 +72,8 @@ public class AccessGatewayFilter implements GlobalFilter {
// private String zuulPrefix; // private String zuulPrefix;
private static final String GATE_WAY_PREFIX = "/api"; private static final String GATE_WAY_PREFIX = "/api";
private static final String GATE_WAY_UNAUTH = "/app/unauth"; @Value("${gate.ignore.unauth}")
private String GATE_WAY_UNAUTH;
@Autowired @Autowired
private UserAuthUtil userAuthUtil; private UserAuthUtil userAuthUtil;
...@@ -248,8 +249,11 @@ public class AccessGatewayFilter implements GlobalFilter { ...@@ -248,8 +249,11 @@ public class AccessGatewayFilter implements GlobalFilter {
*/ */
private boolean isStartWith(String requestUri) { private boolean isStartWith(String requestUri) {
boolean flag = false; boolean flag = false;
if(requestUri.contains(GATE_WAY_UNAUTH)){
return true;
}
for (String s : startWith.split(",")) { for (String s : startWith.split(",")) {
if (requestUri.startsWith(s)||requestUri.contains(GATE_WAY_UNAUTH)) { if (requestUri.startsWith(s)) {
return true; return true;
} }
} }
......
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