ngork访问本地vue+springboot项目出现跨域问题怎么解决

将ngork映射到前端vue项目地址,前端数据可以正常访问,但是利用前端获取后端数据时报错
已经配置了后端跨域访问(不使用ngork前端可正常访问后端)
1)这是直接访问正常获取后端数据

img

2)这是利用ngork获取后端数据出现CORS报错,请求网址没有变化但是referer变了

img

为什么这个时候后端的跨域不起作用了?

@Configuration
public class YjmallConfiguration {
    @Bean
    public CorsWebFilter corsWebFilter(){
        UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
        CorsConfiguration corsConfiguration = new CorsConfiguration();
        //1.配置跨域
        corsConfiguration.addAllowedHeader("*");
        corsConfiguration.addAllowedMethod("*");
        corsConfiguration.addAllowedOrigin("*");
        corsConfiguration.setAllowCredentials(true);

        source.registerCorsConfiguration("/**",corsConfiguration);

        return new CorsWebFilter(source);
    }

}

可分享ngroke资源吗

你ngork用的自定义域名哇;
你前端里面配置的后端请求地址是啥