fix: 修改csrftoken获取问题

pull/8131/head
Jiangjie.Bai 2022-04-21 16:13:03 +08:00 committed by Jiangjie.Bai
parent c3de7b78c2
commit a6d61721dd
1 changed files with 2 additions and 1 deletions

View File

@ -125,7 +125,8 @@ function csrfSafeMethod(method) {
} }
function setAjaxCSRFToken() { function setAjaxCSRFToken() {
const prefix = getCookie('SESSION_COOKIE_NAME_PREFIX', '') let prefix = getCookie('SESSION_COOKIE_NAME_PREFIX');
if (!prefix || [`""`, `''`].indexOf(prefix) > -1) { prefix = ''; }
var csrftoken = getCookie(`${prefix}csrftoken`); var csrftoken = getCookie(`${prefix}csrftoken`);
var sessionid = getCookie(`${prefix}sessionid`); var sessionid = getCookie(`${prefix}sessionid`);