refactor(all): change sql to postgresql
This commit is contained in:
@@ -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()
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user