【发布时间】:2017-02-11 19:01:37
【问题描述】:
addCorsMappings 功能在春季对我不起作用。 我刚刚:
public void addCorsMapping(CorsRegistry registry){
registry.addMapping("/**").allowedOrigins("/**");
}
这是在我的 ServletConfig.java 中声明的。
客户端的错误是:
XMLHttpRequest cannot load http://localhost:8080/oauth/authorize?response_type=code&client_id=backoffice&state=xyz&redirect_uri=http://localhost:8080. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8000' is therefore not allowed access.".
谁能告诉我为什么以及如何调试这个?
【问题讨论】:
标签: spring spring-boot cors spring-security-oauth2