$.ajax({
url: '/translator/get_upload_auth',
type: 'post',
dataType: 'json',
data: {
auth_file_name: auth_file_name,
appid: appid,
key: key,
},
headers: { "X-CSRFtoken": $.cookie("csrftoken") },
success: function(res) {
console.log("授权成功" + res);
},
error: function(data) {
console.log("授权错误了");
console.log(data);
}
})
主要是data后面加
headers: { "X-CSRFtoken": $.cookie("csrftoken") },