|
|
|
@ -110,7 +110,7 @@ public class RouterHandler extends Handler {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 方法2:使用Set集合(推荐,性能更好)
|
|
|
|
|
// 使用Set集合(推荐,性能更好)
|
|
|
|
|
private static final Set<String> STATIC_EXTENSIONS = new HashSet<>(Arrays.asList(
|
|
|
|
|
"html", "js", "css", "png", "jpg", "jpeg", "gif", "ico", "svg",
|
|
|
|
|
"woff", "woff2", "ttf", "eot", "map", "json", "xml", "txt"
|
|
|
|
@ -138,15 +138,15 @@ public class RouterHandler extends Handler {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//微服务间的调用视为内部调用
|
|
|
|
|
if (req.getServletPath().endsWith("_Internal")) {
|
|
|
|
|
renderJson(res, new RetBean(RetBean.ERROR, "微服务间内部接口调用,是不需要走网关的!").toString());
|
|
|
|
|
isHandled[0] = true; //停止filter
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//如果是白名单,不检查jwt,否则需要检查jwt
|
|
|
|
|
if (!GwApplication.whiteSet.contains(servletPath)) {
|
|
|
|
|
//微服务间的调用视为内部调用
|
|
|
|
|
if (req.getServletPath().endsWith("_Internal")) {
|
|
|
|
|
renderJson(res, new RetBean(RetBean.ERROR, "微服务间内部接口调用,是不需要走网关的!").toString());
|
|
|
|
|
isHandled[0] = true; //停止filter
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//是不是通过了登录检查?
|
|
|
|
|
boolean canPass = true;
|
|
|
|
|
//1、存在Session,检查是不是正确的Session
|
|
|
|
|