From 70e8a038884b553945b81e1745e29f19cfefe014 Mon Sep 17 00:00:00 2001 From: ibuler Date: Thu, 18 Nov 2021 18:40:36 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=20mfa=20=E7=99=BB?= =?UTF-8?q?=E5=BD=95=E6=97=B6=E7=9A=84=20focus=20=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/jumpserver/settings/custom.py | 4 ++++ apps/templates/_mfa_login_field.html | 11 ++++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/apps/jumpserver/settings/custom.py b/apps/jumpserver/settings/custom.py index d5088ea48..0673cbc1d 100644 --- a/apps/jumpserver/settings/custom.py +++ b/apps/jumpserver/settings/custom.py @@ -143,12 +143,16 @@ SMS_TEST_PHONE = CONFIG.SMS_TEST_PHONE # Alibaba ALIBABA_ACCESS_KEY_ID = CONFIG.ALIBABA_ACCESS_KEY_ID ALIBABA_ACCESS_KEY_SECRET = CONFIG.ALIBABA_ACCESS_KEY_SECRET +ALIBABA_VERIFY_SIGN_NAME = CONFIG.ALIBABA_VERIFY_SIGN_NAME +ALIBABA_VERIFY_TEMPLATE_CODE = CONFIG.ALIBABA_VERIFY_TEMPLATE_CODE ALIBABA_SMS_SIGN_AND_TEMPLATES = CONFIG.ALIBABA_SMS_SIGN_AND_TEMPLATES # TENCENT TENCENT_SECRET_ID = CONFIG.TENCENT_SECRET_ID TENCENT_SECRET_KEY = CONFIG.TENCENT_SECRET_KEY TENCENT_SDKAPPID = CONFIG.TENCENT_SDKAPPID +TENCENT_VERIFY_SIGN_NAME = CONFIG.TENCENT_VERIFY_SIGN_NAME +TENCENT_VERIFY_TEMPLATE_CODE = CONFIG.TENCENT_VERIFY_TEMPLATE_CODE TENCENT_SMS_SIGN_AND_TEMPLATES = CONFIG.TENCENT_SMS_SIGN_AND_TEMPLATES # 公告 diff --git a/apps/templates/_mfa_login_field.html b/apps/templates/_mfa_login_field.html index 52918acfd..8aa3cbdd6 100644 --- a/apps/templates/_mfa_login_field.html +++ b/apps/templates/_mfa_login_field.html @@ -75,18 +75,19 @@ } $('.input-style').each(function (i, ele){ - $(ele).attr('name', '') + $(ele).attr('name', 'code-test') }) const currentMFAInputRef = $('#mfa-' + name + ' .input-style') - currentMFAInputRef.attr('name', 'code').attr('required', true) + currentMFAInputRef.attr('name', 'code') // 登录页时,不应该默认focus const usernameRef = $('input[name="username"]') if (!usernameRef || usernameRef.length === 0) { - currentMFAInputRef.focus() + setTimeout(() => { + currentMFAInputRef.focus() + }) } - currentMFAInputRef.attr('name', 'code') } function sendChallengeCode(currentBtn) { @@ -127,4 +128,4 @@ flash_message: false }) } - \ No newline at end of file +