diff --git a/cloud-common/src/main/java/com/cm/common/config/FilterConfig.java b/cloud-common/src/main/java/com/cm/common/config/FilterConfig.java index 1ea38f2..f037d22 100644 --- a/cloud-common/src/main/java/com/cm/common/config/FilterConfig.java +++ b/cloud-common/src/main/java/com/cm/common/config/FilterConfig.java @@ -22,7 +22,7 @@ public class FilterConfig { public FilterRegistrationBean appFilterRegister() { FilterRegistrationBean filterRegistrationBean = new FilterRegistrationBean(); filterRegistrationBean.setFilter(new AppFilter()); - filterRegistrationBean.addUrlPatterns("/app/*"); + filterRegistrationBean.addUrlPatterns("/app/*", "/approute/*"); filterRegistrationBean.setName("appFilter"); filterRegistrationBean.setOrder(1); return filterRegistrationBean; diff --git a/cloud-common/src/main/java/com/cm/common/filter/AppFilter.java b/cloud-common/src/main/java/com/cm/common/filter/AppFilter.java index f18e6c4..df5c73a 100644 --- a/cloud-common/src/main/java/com/cm/common/filter/AppFilter.java +++ b/cloud-common/src/main/java/com/cm/common/filter/AppFilter.java @@ -33,8 +33,22 @@ public class AppFilter implements Filter { private static final Logger LOG = LoggerFactory.getLogger(AppFilter.class); private AntPathMatcher antPathMatcher; + /** + * APP登录 + */ private static final String URL_LOGIN = "/**/app/sign/login"; + /** + * APP下载 + */ private static final String URL_DOWNLOAD_APP = "/**/app/appversion/downloadapp/**"; + /** + * APP放行 + */ + private static final String URL_RELEASE_APP = "/**/app/**/**release/**"; + /** + * APP路由放行 + */ + private static final String URL_RELEASE_APP_ROUTE = "/**/approute/**/**release/**"; @Override public void init(FilterConfig filterConfig) throws ServletException { @@ -46,7 +60,11 @@ public class AppFilter implements Filter { HttpServletRequest request = (HttpServletRequest) servletRequest; HttpServletResponse response = (HttpServletResponse) servletResponse; String requestUri = request.getRequestURI(); - if (antPathMatcher.match(URL_LOGIN, requestUri) || antPathMatcher.match(URL_DOWNLOAD_APP, requestUri)) { + boolean matcher = antPathMatcher.match(URL_LOGIN, requestUri) + || antPathMatcher.match(URL_DOWNLOAD_APP, requestUri) + || antPathMatcher.match(URL_RELEASE_APP, requestUri) + || antPathMatcher.match(URL_RELEASE_APP_ROUTE, requestUri); + if (matcher) { filterChain.doFilter(request, response); return; }