|
@@ -23,8 +23,7 @@ import org.springframework.context.annotation.Bean;
|
|
import org.springframework.context.annotation.Configuration;
|
|
import org.springframework.context.annotation.Configuration;
|
|
import org.springframework.context.annotation.DependsOn;
|
|
import org.springframework.context.annotation.DependsOn;
|
|
|
|
|
|
-import java.util.List;
|
|
|
|
-import java.util.List;
|
|
|
|
|
|
+import java.util.HashMap;
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
|
|
|
|
@Configuration
|
|
@Configuration
|
|
@@ -142,6 +141,31 @@ public class ShiroConfig {
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
|
|
+ * 过滤器链
|
|
|
|
+ */
|
|
|
|
+ private Map<String, String> filterChainDefinition() {
|
|
|
|
+ Map<String, String> map = MapUtil.newHashMap(20, true);
|
|
|
|
+ map.put("/static/**", "anon");
|
|
|
|
+ map.put("/v1/test/**", "anon");
|
|
|
|
+ map.put("/v1/login", "anon");
|
|
|
|
+ map.put("/v1/rsa-key", "anon");
|
|
|
|
+ map.put("/v1/**", "jwt");
|
|
|
|
+ map.put("/**", "jwt");
|
|
|
|
+ return map;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+// @Bean
|
|
|
|
+// public JwtContext jwtUtil() {
|
|
|
|
+// return new JwtContext(this.properties);
|
|
|
|
+// }
|
|
|
|
+
|
|
|
|
+ private Map<String, Filter> filterMap() {
|
|
|
|
+ HashMap<String, Filter> map = MapUtil.newHashMap();
|
|
|
|
+ map.put("jwt", new JwtFilter(this.properties, this.jwtContext));
|
|
|
|
+ return map;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
* Shiro过滤器
|
|
* Shiro过滤器
|
|
*/
|
|
*/
|
|
@Bean("shiroFilter")
|
|
@Bean("shiroFilter")
|