refactor(all): change sql to postgresql

This commit is contained in:
merlin
2025-10-31 10:21:36 +08:00
parent 4f84603d82
commit e4f032a7f0
35 changed files with 154 additions and 587 deletions

View File

@@ -13,7 +13,6 @@ import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import xin.merlin.myblog_server.security.JWTAuthenticationFilter;
import static org.springframework.security.config.Customizer.withDefaults;
@Configuration
@EnableWebSecurity
@@ -25,7 +24,6 @@ public class SecurityConfig {
@Bean
public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
http
.cors(withDefaults()) // <<<<<< 这里明确加上 withDefaults()
.csrf(AbstractHttpConfigurer::disable)
.sessionManagement(session -> session.sessionCreationPolicy(SessionCreationPolicy.STATELESS))
.authorizeHttpRequests(authz -> authz
@@ -33,10 +31,8 @@ public class SecurityConfig {
"/login",
"/register",
"/test",
"/admin/login",
"/admin/register",
"/code/sendcode",
"/code/verifycode"
"/code/**",
"/blog/**"
).permitAll()
.anyRequest().authenticated()
)