Skip to content

Commit 22111b8

Browse files
committed
add antMatchers urls
1 parent 5b2a013 commit 22111b8

File tree

8 files changed

+19
-9
lines changed

8 files changed

+19
-9
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
<groupId>com.codingapi.springboot</groupId>
1313
<artifactId>springboot-parent</artifactId>
14-
<version>1.1.1</version>
14+
<version>1.1.2</version>
1515

1616
<url>https://github.com/codingapi/springboot-framewrok</url>
1717
<name>springboot-parent</name>

springboot-example/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<parent>
55
<groupId>com.codingapi.springboot</groupId>
66
<artifactId>springboot-parent</artifactId>
7-
<version>1.1.1</version>
7+
<version>1.1.2</version>
88
</parent>
99
<artifactId>springboot-example</artifactId>
1010

springboot-starter-data-permission/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<artifactId>springboot-parent</artifactId>
88
<groupId>com.codingapi.springboot</groupId>
9-
<version>1.1.1</version>
9+
<version>1.1.2</version>
1010
</parent>
1111

1212

springboot-starter-security-jwt/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<artifactId>springboot-parent</artifactId>
88
<groupId>com.codingapi.springboot</groupId>
9-
<version>1.1.1</version>
9+
<version>1.1.2</version>
1010
</parent>
1111

1212
<artifactId>springboot-starter-security-jwt</artifactId>

springboot-starter-security-jwt/src/main/java/com/codingapi/springboot/security/AutoConfiguration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public SecurityFilterChain filterChain(HttpSecurity http,Jwt jwt,SecurityJwtProp
7878
.accessDeniedHandler(new MyAccessDeniedHandler())
7979
.and()
8080
.authorizeRequests()
81-
.antMatchers(properties.getAuthenticatedUrl()).authenticated()
81+
.antMatchers(properties.getAuthenticatedUrls()).authenticated()
8282
.and()
8383
//default login url :/login
8484
.formLogin()

springboot-starter-security-jwt/src/main/java/com/codingapi/springboot/security/configurer/WebSecurityConfigurer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public class WebSecurityConfigurer implements WebSecurityCustomizer {
1515
@Override
1616
public void customize(WebSecurity web) {
1717
//ignoring security filters request url
18-
web.ignoring().antMatchers(securityJwtProperties.getIgnoreUrl());
18+
web.ignoring().antMatchers(securityJwtProperties.getIgnoreUrls());
1919
}
2020

2121
}

springboot-starter-security-jwt/src/main/java/com/codingapi/springboot/security/properties/SecurityJwtProperties.java

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ public class SecurityJwtProperties {
2626
/**
2727
* 权限拦截URL
2828
*/
29-
private String authenticatedUrl = "/api/**";
29+
private String authenticatedUrls = "/api/**";
30+
3031

3132
/**
3233
* 登录接口地址
@@ -41,5 +42,14 @@ public class SecurityJwtProperties {
4142
/**
4243
* 放开接口地址
4344
*/
44-
private String ignoreUrl = "/open/**";
45+
private String ignoreUrls = "/open/**";
46+
47+
48+
public String[] getIgnoreUrls(){
49+
return ignoreUrls.split(",");
50+
}
51+
52+
public String[] getAuthenticatedUrls(){
53+
return authenticatedUrls.split(",");
54+
}
4555
}

springboot-starter/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<parent>
55
<groupId>com.codingapi.springboot</groupId>
66
<artifactId>springboot-parent</artifactId>
7-
<version>1.1.1</version>
7+
<version>1.1.2</version>
88
</parent>
99
<artifactId>springboot-starter</artifactId>
1010

0 commit comments

Comments
 (0)