mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-09-14 06:19:17 +00:00
fix: 修复ajax请求携带csrftoken问题
This commit is contained in:
committed by
Jiangjie.Bai
parent
516cb05d69
commit
be2708f83d
@@ -125,8 +125,9 @@ function csrfSafeMethod(method) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function setAjaxCSRFToken() {
|
function setAjaxCSRFToken() {
|
||||||
var csrftoken = getCookie('csrftoken');
|
const prefix = getCookie('SESSION_COOKIE_NAME_PREFIX', '')
|
||||||
var sessionid = getCookie('sessionid');
|
var csrftoken = getCookie(`${prefix}csrftoken`);
|
||||||
|
var sessionid = getCookie(`${prefix}sessionid`);
|
||||||
|
|
||||||
$.ajaxSetup({
|
$.ajaxSetup({
|
||||||
beforeSend: function (xhr, settings) {
|
beforeSend: function (xhr, settings) {
|
||||||
|
Reference in New Issue
Block a user