1. xxl-job 设置虚拟用户 0 登录操作

2. Access-Control-Expose-Headers 允许暴露 content-disposition
This commit is contained in:
chenbowen
2025-09-25 12:01:19 +08:00
parent 32cb704e4f
commit f33d3f07b8
9 changed files with 536 additions and 3 deletions

View File

@@ -88,6 +88,7 @@ public class ZtWebAutoConfiguration implements WebMvcConfigurer {
config.addAllowedOriginPattern("*"); // 设置访问源地址
config.addAllowedHeader("*"); // 设置访问源请求头
config.addAllowedMethod("*"); // 设置访问源请求方法
config.addExposedHeader("content-disposition"); // 暴露 content-disposition 头,用于文件下载
// 创建 UrlBasedCorsConfigurationSource 对象
UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
source.registerCorsConfiguration("/**", config); // 对接口配置跨域设置