Commit ec87d199 authored by Quxl's avatar Quxl

x

parent d59c4e73
...@@ -37,7 +37,7 @@ public class WebMvcConfig extends WebMvcConfigurerAdapter { ...@@ -37,7 +37,7 @@ public class WebMvcConfig extends WebMvcConfigurerAdapter {
@Override @Override
public void addInterceptors(InterceptorRegistry registry) { public void addInterceptors(InterceptorRegistry registry) {
registry.addInterceptor(logInterceptor).addPathPatterns("/**").excludePathPatterns("/*.html").excludePathPatterns("/assets/**"); registry.addInterceptor(logInterceptor).addPathPatterns("/**").excludePathPatterns("/*.html").excludePathPatterns("/assets/**");
registry.addInterceptor(adminInterceptor).addPathPatterns("/admin").excludePathPatterns("/admin/*.html").excludePathPatterns("/assets/**").excludePathPatterns("/admin/doLogin"); registry.addInterceptor(adminInterceptor).addPathPatterns("/admin/**").excludePathPatterns("/admin/*.html").excludePathPatterns("/assets/**").excludePathPatterns("/admin/doLogin");
} }
@Override @Override
......
...@@ -22,6 +22,7 @@ public class AdminLoginInterceptor extends HandlerInterceptorAdapter { ...@@ -22,6 +22,7 @@ public class AdminLoginInterceptor extends HandlerInterceptorAdapter {
@Override @Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
System.out.println(adminTokenService.getLoginBean());
if(adminTokenService.getLoginBean() == null) { if(adminTokenService.getLoginBean() == null) {
throw new XRException("请登陆后再操作", 300); throw new XRException("请登陆后再操作", 300);
} }
......
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