问题
Access to XMLHttpRequest at 'http://localhost:8001/eduservice/user/login' from origin 'http://localhost:9528' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.
Access-Control-Allow-Origin
通过一个地址去访问一个地址,这个过程如果三个地方有一个地方不一样就会出现跨域问题
- 访问协议 http https
- ip地址 192.168.1.1
- 端口号 8080 8001
解决上面的问题
http://localhost:8001
http://localhost:9528
端口不一样
@CrossOrigin //解决跨域