fix: 修复ajax请求携带csrftoken问题

pull/8088/head
Jiangjie.Bai 2022-04-19 14:26:17 +08:00 committed by Jiangjie.Bai
parent 516cb05d69
commit be2708f83d
1 changed files with 3 additions and 2 deletions

View File

@ -125,8 +125,9 @@ function csrfSafeMethod(method) {
}
function setAjaxCSRFToken() {
var csrftoken = getCookie('csrftoken');
var sessionid = getCookie('sessionid');
const prefix = getCookie('SESSION_COOKIE_NAME_PREFIX', '')
var csrftoken = getCookie(`${prefix}csrftoken`);
var sessionid = getCookie(`${prefix}sessionid`);
$.ajaxSetup({
beforeSend: function (xhr, settings) {