spring secur 默认开启阻止csrf的攻击,如果我们用spring mvc架构的话,这点很好解决,但是如果我们不用spring mvc做前后端分离的话,问题就很多了
网上有很多教程,拼来拼去来回改都吐了
https://blog.csdn.net/u012702547/article/details/106206339/ 这篇还是挺有效的
但是看csdn不如跑去翻文档
第14节 Protection Against Exploits
给出了Include the CSRF Token的解决方法
Spring Security can easily be configured to store the expected CSRF token in a cookie. By storing the expected CSRF in a cookie, JavaScript frameworks like