客户端网站(asp.net)具有触发 onclick 事件的图标。提供者网站(java)onClick,
function goTourl(){
window.open(url)
}
网址是这样的:https://example.org/j_spring_security_check?name=testing&pass=testing'
问题是,在春季 3 登录提交不允许获取请求(我认为)..
使用以下 javascript 发布,但出现 CSRF 令牌问题。
function openWindowWithPost(url,name,keys,values)
{
var newWindow = window.open(url, name);
if (!newWindow) return false;
var html = "";
html += "<html><head></head><body><form id='formid' method='post' action='" + url + "'>";
if (keys && values && (keys.length == values.length))
for (var i=0; i < keys.length; i++)
html += "<input type='hidden' name='" + keys[i] + "' value='" + values[i] + "'/>";
html += "</form><script type='text/javascript'>document.getElementById(\"formid\").submit()</script></body></html>";
newWindow.document.write(html);
return newWindow;
}