Commit 9248b8f0 authored by muhong's avatar muhong

修改 拦截器

parent 6c226395
...@@ -31,12 +31,6 @@ public class WebMvcConfiguration implements WebMvcConfigurer { ...@@ -31,12 +31,6 @@ public class WebMvcConfiguration implements WebMvcConfigurer {
.addPathPatterns("/**") .addPathPatterns("/**")
.excludePathPatterns("/*.html", "/**/*.html", "/**/*.css", "/**/*.js" .excludePathPatterns("/*.html", "/**/*.html", "/**/*.css", "/**/*.js"
, "/wx/user/loginByWx", "/wx/user/loginByMobile", "/wx/user/loginRegCaptcha", "/wx/user/updateRegCaptcha", "/wx/user/login", "/wx/user/fillCode" , "/wx/user/loginByWx", "/wx/user/loginByMobile", "/wx/user/loginRegCaptcha", "/wx/user/updateRegCaptcha", "/wx/user/login", "/wx/user/fillCode"
// , "/wx/item/page", "/wx/item/info", "/wx/item/findNames" , "/wx/queryPrice/**");
// , "/wx/favorites/info", "/wx/favorites/itemList"
// , "/wx/keyword/recommend", "/wx/queryPrice/**");
, "/wx/user/loginByWx", "/wx/user/loginByMobile", "/wx/user/loginRegCaptcha", "/wx/user/updateRegCaptcha", "/wx/user/login"
, "/wx/item/page", "/wx/item/info", "/wx/item/findNames"
, "/wx/favorites/info", "/wx/favorites/itemList"
, "/wx/keyword/recommend", "/wx/queryPrice/**");
} }
} }
...@@ -44,7 +44,9 @@ public class LoginInterceptor implements HandlerInterceptor { ...@@ -44,7 +44,9 @@ public class LoginInterceptor implements HandlerInterceptor {
String token = request.getHeader("Authorization"); String token = request.getHeader("Authorization");
Switch switchh = switchService.findOnly(); Switch switchh = switchService.findOnly();
boolean isOpen = Objects.nonNull(switchh) && switchh.getState() == 1; boolean isOpen = Objects.nonNull(switchh) && switchh.getState() == 1;
logger.info("isOpen:" + isOpen);
String url = request.getRequestURI(); String url = request.getRequestURI();
logger.info("url:" + url);
if (!isOpen) { if (!isOpen) {
if (Arrays.asList(excludeUrl).contains(url)) { if (Arrays.asList(excludeUrl).contains(url)) {
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