Skip to content

Commit 7eef458

Browse files
committed
饼图
1 parent ad19b26 commit 7eef458

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/main/java/com/layor/tinyflow/config/SecurityConfig.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
import org.springframework.web.cors.CorsConfigurationSource;
2323
import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
2424

25+
import org.springframework.http.HttpMethod;
26+
2527
import java.util.Arrays;
2628
import java.util.List;
2729

@@ -69,10 +71,10 @@ public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Excepti
6971
.requestMatchers("/api/admin/**").hasRole("ADMIN")
7072

7173
// PUT/DELETE 短链相关操作需要认证(修改、删除操作需要登录)
72-
.requestMatchers("PUT", "/api/urls/**").authenticated()
73-
.requestMatchers("DELETE", "/api/urls/**").authenticated()
74-
.requestMatchers("PUT", "/api/*").authenticated()
75-
.requestMatchers("DELETE", "/api/*").authenticated()
74+
.requestMatchers(HttpMethod.PUT, "/api/urls/**").authenticated()
75+
.requestMatchers(HttpMethod.DELETE, "/api/urls/**").authenticated()
76+
.requestMatchers(HttpMethod.PUT, "/api/*").authenticated()
77+
.requestMatchers(HttpMethod.DELETE, "/api/*").authenticated()
7678

7779
// 其他所有接口需要认证
7880
.anyRequest().authenticated()

0 commit comments

Comments
 (0)