我找到了解决办法。如上所述,它来自 Springs HttpSessionRequestCache。这是一项性能优化功能,可以删除
Spring Boot 3.0.2 登录后请求 URL 添加“继续”查询参数
@Bean
SecurityFilterChain springSecurity(HttpSecurity http) throws Exception {
HttpSessionRequestCache requestCache = new HttpSessionRequestCache();
requestCache.setMatchingRequestParameterName(null);
http
// ...
.requestCache((cache) -> cache
.requestCache(requestCache)
);
return http.build();
}