在前段ajax里加入

xhrFields:{withCredentials:true},

springboot前后端分离,请求跨域

后端的代码中加入

@CrossOrigin(origins = {"*"},allowCredentials = "true")

springboot前后端分离,请求跨域

 

相关文章: