File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
src/main/java/com/layor/tinyflow/config Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change 2222import org .springframework .web .cors .CorsConfigurationSource ;
2323import org .springframework .web .cors .UrlBasedCorsConfigurationSource ;
2424
25+ import org .springframework .http .HttpMethod ;
26+
2527import java .util .Arrays ;
2628import 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 ()
You can’t perform that action at this time.
0 commit comments