1.跨域问题说明:后端域名为A.abc.com,前端域名为B.abc.com. 2.后端设置一个cookie发送给前台,domain应该是setDomain(“abc.com”),而不是setDomain(“B.abc.com”) 3.另外,还要实现WebMvcConfigurerr配置加入Cors的跨域 @Configuration public class WebConfig implements WebMvcConfigurer { @Override public void addCor
1.通过允许跨域访问实现了跨域请求,但为了使每个请求带上session信息,我设置了withCredentials ,即: axios.defaults.withCredentials = true 然后跨域请求时会出现如下问题: Response to preflight request doesn't pass access control check: The value of the 'Access-Control-Allow-Origin' header in the response