前端服务地址+端口:http://localhost:8080
后端服务地址+端口:http://localhost:8081
问题:
前端利用axios请求后端接口,因为端口不一样不属于同源,一直报错No 'Access-Control-Allow-Origin' header
解决:
在后端Controller类添加@CrossOrigin注解
前端服务地址+端口:http://localhost:8080
后端服务地址+端口:http://localhost:8081
问题:
前端利用axios请求后端接口,因为端口不一样不属于同源,一直报错No 'Access-Control-Allow-Origin' header
解决:
在后端Controller类添加@CrossOrigin注解