最近在写前后端分离的项目,react.js写的前端访问 springboot写的api时报错:Redirect has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header'

问题解析

这是一个CORS跨域访问错误,大概意思是被服务器端同源策略拦截导致,因为项目是前后端分离开发,所以服务器会判断前端属于跨域请求。

解决方法

在springboot中设置允许跨域请求即可:
debug: 解决 Redirect has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header'

相关文章:

  • 2022-12-23
  • 2021-09-11
  • 2022-12-23
  • 2022-01-01
  • 2021-09-06
  • 2022-12-23
  • 2021-11-21
  • 2021-05-29
猜你喜欢
  • 2021-08-26
  • 2021-11-05
  • 2021-04-12
  • 2021-06-18
  • 2021-05-23
  • 2022-12-23
相关资源
相似解决方案