跨域问题
调用接口的错误信息
Access to XMLHttpRequest at 'http://***.**.***.**:8080/utils/getPowerStation' from origin 'http://localhost:8080' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
我项目是vue+axios 调用java写的接口,
spring项目在相应方法上加上@CrossOrigin这个注解可以解决跨域问题。
参考:https://blog.csdn.net/weixin_44100313/article/details/108444163