peng
2025-11-06 c4938f6f4e839890b032c75c7a57333a6a9157a9
backend/src/main/java/com/rongyichuang/config/SecurityConfig.java
@@ -48,7 +48,9 @@
            .csrf(csrf -> csrf.disable())
            .sessionManagement(session -> session.sessionCreationPolicy(SessionCreationPolicy.STATELESS))
            .authorizeHttpRequests(auth -> auth
                .requestMatchers("/auth/**", "/actuator/**", "/test/**", "/cleanup/**").permitAll()
                // 注意:应用设置了 context-path=/api,为避免匹配歧义,这里同时匹配去除和包含 context-path 的路径
                .requestMatchers("/auth/**", "/api/auth/**", "/actuator/**", "/test/**", "/cleanup/**").permitAll()
                .requestMatchers("/api/health/**").permitAll() // 允许健康检查端点访问
                .requestMatchers("/upload/**").permitAll()
                .requestMatchers("/graphiql/**", "/graphql/**", "/api/graphql/**", "/api/graphiql/**").permitAll() // 允许GraphQL和GraphiQL访问
                .requestMatchers("/**/graphql", "/**/graphiql").permitAll() // 更宽泛的GraphQL路径匹配