axios 跨域 sessionid 每次访问不一致的问题

白昼怎懂夜的黑 提交于 2021-01-13 05:46:05

百度一晚上,都是说要设置

axios.defaults.withCredentials=true;

然后在controller 上加上

@CrossOrigin(origins = "http://localhost:9080", maxAge = 3600)

其实根本不好用,还少一个参数

allowCredentials = "true"

下面这样才行因为 allowCredentials 默认是 "false"

@CrossOrigin(origins = "http://localhost:9080", maxAge = 3600,allowCredentials = "true")
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!