From 7d0a19635adca26e2429c4b8dceab0f133d4c946 Mon Sep 17 00:00:00 2001 From: fit2bot <68588906+fit2bot@users.noreply.github.com> Date: Wed, 17 Aug 2022 14:45:02 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E7=99=BB=E5=BD=95?= =?UTF-8?q?=E7=AC=A6=E5=90=88=E6=8B=92=E7=BB=9D=E6=97=B6=20=E7=99=BB?= =?UTF-8?q?=E5=BD=95=E6=97=A5=E5=BF=97=E7=B1=BB=E5=9E=8B=E5=BC=82=E5=B8=B8?= =?UTF-8?q?=E9=97=AE=E9=A2=98=20(#8758)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: feng626 <1304903146@qq.com> --- .../templates/authentication/login_wait_confirm.html | 5 ++++- apps/static/js/jumpserver.js | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/apps/authentication/templates/authentication/login_wait_confirm.html b/apps/authentication/templates/authentication/login_wait_confirm.html index bd94c1986..a74c8db26 100644 --- a/apps/authentication/templates/authentication/login_wait_confirm.html +++ b/apps/authentication/templates/authentication/login_wait_confirm.html @@ -98,7 +98,10 @@ function doRequestAuth() { }, error: function (text, data) { }, - flash_message: false + beforeSend: function(request) { + request.setRequestHeader("X-JMS-LOGIN-TYPE", "W"); + }, + flash_message: false, // 是否显示flash消息 }) } function initClipboard() { diff --git a/apps/static/js/jumpserver.js b/apps/static/js/jumpserver.js index 3edf445b0..e3537cb84 100644 --- a/apps/static/js/jumpserver.js +++ b/apps/static/js/jumpserver.js @@ -270,11 +270,13 @@ function requestApi(props) { if (typeof(dataBody) === "object") { dataBody = JSON.stringify(dataBody) } + var beforeSend = props.beforeSend || function (request) {} $.ajax({ url: props.url, type: props.method || "PATCH", data: dataBody, + beforeSend: beforeSend, contentType: props.content_type || "application/json; charset=utf-8", dataType: props.data_type || "json" }).done(function (data, textStatue, jqXHR) {