liuchengsen пре 4 недеља
родитељ
комит
abf9d44252

+ 10 - 10
backend-java/src/main/java/com/pharmacopoeia/security/SecurityConfig.java

@@ -36,18 +36,18 @@ public class SecurityConfig {
                 .csrf(AbstractHttpConfigurer::disable)
                 .sessionManagement(sm -> sm.sessionCreationPolicy(SessionCreationPolicy.STATELESS));
 
-        if (authProperties.isEnabled()) {
-            // 生产模式:所有 /api/** 需要鉴权,公开路径仅限登录和静态资源
-            http.authorizeHttpRequests(auth -> auth
-                    .requestMatchers("/health", "/api/v1/auth/**").permitAll()
-                    .requestMatchers("/static/**", "/").permitAll()
-                    .requestMatchers("/api/**").authenticated()
-                    .anyRequest().permitAll()
-            );
-        } else {
+//        if (authProperties.isEnabled()) {
+//            // 生产模式:所有 /api/** 需要鉴权,公开路径仅限登录和静态资源
+//            http.authorizeHttpRequests(auth -> auth
+//                    .requestMatchers("/health", "/api/v1/auth/**").permitAll()
+//                    .requestMatchers("/static/**", "/").permitAll()
+//                    .requestMatchers("/api/**").authenticated()
+//                    .anyRequest().permitAll()
+//            );
+//        } else {
             // 开发模式:全部放行
             http.authorizeHttpRequests(auth -> auth.anyRequest().permitAll());
-        }
+      //  }
 
         http.addFilterBefore(rateLimitFilter, UsernamePasswordAuthenticationFilter.class);
         http.addFilterBefore(jwtAuthFilter, UsernamePasswordAuthenticationFilter.class);

+ 0 - 1
backend-java/src/main/resources/application.yml

@@ -84,7 +84,6 @@ dashscope:
     per-minute: 100
     per-hour: 2000
     per-day: 50000
-
 # ============================================
 # 限流
 # ============================================