Commit 15496373 by 罗承锋

优化垂直鉴权

parent bee4dde4
package com.winsun.item.modular.config; package com.winsun.item.modular.config;
import com.winsun.intercept.AuthIntercept;
import com.winsun.item.modular.intercept.ChangePwdInterceptor; import com.winsun.item.modular.intercept.ChangePwdInterceptor;
import com.winsun.item.modular.intercept.LoginInterceptor; import com.winsun.item.modular.intercept.LoginInterceptor;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -8,6 +9,9 @@ import org.springframework.context.annotation.Configuration; ...@@ -8,6 +9,9 @@ import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry; import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport; import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;
import java.util.ArrayList;
import java.util.List;
/** /**
* @Author xuede * @Author xuede
...@@ -23,6 +27,9 @@ public class LoginApplicaionConfig extends WebMvcConfigurationSupport { ...@@ -23,6 +27,9 @@ public class LoginApplicaionConfig extends WebMvcConfigurationSupport {
@Autowired @Autowired
private ChangePwdInterceptor changePwdInterceptor; private ChangePwdInterceptor changePwdInterceptor;
@Autowired
private AuthIntercept authIntercept;
@Override @Override
...@@ -32,6 +39,10 @@ public class LoginApplicaionConfig extends WebMvcConfigurationSupport { ...@@ -32,6 +39,10 @@ public class LoginApplicaionConfig extends WebMvcConfigurationSupport {
registry.addInterceptor(loginInterceptor).addPathPatterns("/login"); registry.addInterceptor(loginInterceptor).addPathPatterns("/login");
registry.addInterceptor(changePwdInterceptor).addPathPatterns("/mgr/changePwd"); registry.addInterceptor(changePwdInterceptor).addPathPatterns("/mgr/changePwd");
registry.addInterceptor(changePwdInterceptor).addPathPatterns("/mgr/changeOtherPwd"); registry.addInterceptor(changePwdInterceptor).addPathPatterns("/mgr/changeOtherPwd");
List<String> s = new ArrayList<>();
s.add("/login");
s.add("/getPhoneCode");
registry.addInterceptor(authIntercept).excludePathPatterns(s);
super.addInterceptors(registry); super.addInterceptors(registry);
} }
......
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