spring security post 请求403问题

spring security post 请求403问题

加入以下代码

	
	<meta name="_csrf" th:content="${_csrf.token}" />
	
	<meta name="_csrf_header" th:content="${_csrf.headerName}" />

	<script>
		$(function () {

		var token = $("meta[name='_csrf']").attr("content");
		var header = $("meta[name='_csrf_header']").attr("content");
		$(document).ajaxSend(function (e, xhr, options) {
			xhr.setRequestHeader(header, token);
		});
	});
	script>

你可能感兴趣的:(spring security post 请求403问题)