使用https://github.com/dabeng/OrgChart我将如何在 ajax 调用上设置请求标头
我正在尝试以下
$('#chart-container').orgchart({
'data' : '/api/v1/profiles/orgchart/',
'beforeSend': function(xhr){xhr.setRequestHeader('X-CSRF-TOKEN', token);},
'nodeContent': 'account_firstname'
});
但这不起作用