class CorsConfig {

    /**
     * CORS跨域设置
     *
     * @return
     */
    @Bean
    public CorsFilter corsFilter() {<FILL_FUNCTION_BODY>}

}

        CorsConfiguration corsConfiguration = new CorsConfiguration();
        // 允许访问的源
        corsConfiguration.addAllowedOriginPattern("*");
        // 允许访问的请求头
        corsConfiguration.addAllowedHeader("*");
        // 允许访问的请求方式
        corsConfiguration.setAllowedMethods(Arrays.asList("OPTION", "GET", "POST"));
        // 是否允许发送cookie
        corsConfiguration.setAllowCredentials(true);
        // 允许响应的头
        corsConfiguration.addExposedHeader("*");
        UrlBasedCorsConfigurationSource configurationSource = new UrlBasedCorsConfigurationSource();
        configurationSource.registerCorsConfiguration("/**", corsConfiguration);
        return new CorsFilter(configurationSource);
    
<no_super_class>