pull/1121/head
梁宇奇 2025-11-11 23:46:51 +08:00
parent f0143b1190
commit ad3e6512e9
1 changed files with 1 additions and 7 deletions

View File

@ -102,13 +102,7 @@ public class SecurityConfig
.csrf(csrf -> csrf.disable())
// 禁用HTTP响应标头
.headers((headersCustomizer) -> {
headersCustomizer.cacheControl(cache -> cache.disable()).frameOptions(options -> options.sameOrigin())
.addHeaderWriter((request, response) -> {
// html接口响应头特殊处理
if (StrUtil.startWith(request.getRequestURI(),"/rest/v1/common/html/content/")){
response.setHeader("X-Frame-Options","ALLOWALL");
}
});
headersCustomizer.cacheControl(cache -> cache.disable()).frameOptions(options -> options.sameOrigin());
})
// 认证失败处理类
.exceptionHandling(exception -> exception.authenticationEntryPoint(unauthorizedHandler))