欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

跨域问题 has been blocked by CORS policy: No ‘Access-Control-Allow-Origin‘ header is

程序员文章站 2022-07-10 15:42:02
...

错误信息

has been blocked by CORS policy: No 'Access-Control-Allow-Origin'
 header is present on the requested resource.

意思是:cors阻止了你请求的资源(跨域问题);

解决方法:

spring项目在相应方法上加上这个注解

@CrossOrigin

跨域问题 has been blocked by CORS policy: No ‘Access-Control-Allow-Origin‘ header is
这样这个错误就解决了。希望可以有所帮助!

相关标签: java 跨域 vue