From d6395b64fab812112fbfcd904cebbce8f447a2b1 Mon Sep 17 00:00:00 2001 From: fit2bot <68588906+fit2bot@users.noreply.github.com> Date: Mon, 15 Nov 2021 16:51:05 +0800 Subject: [PATCH] merge: with dev (#7195) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: 修复登录mfa时,选择了禁用的 * fix: mfa focus Co-authored-by: ibuler --- apps/templates/_mfa_login_field.html | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/apps/templates/_mfa_login_field.html b/apps/templates/_mfa_login_field.html index 8a9a1eb71..31d59ec24 100644 --- a/apps/templates/_mfa_login_field.html +++ b/apps/templates/_mfa_login_field.html @@ -77,6 +77,14 @@ $('.input-style').each(function (i, ele){ $(ele).attr('name', '').attr('required', false) }) + + const currentMFAInput = $('#mfa-' + name + ' .input-style') + currentMFAInput.attr('name', 'code').attr('required', true) + + // 登录页时,不应该默认focus + if ($('input[name="username"]').length == 0) { + currentMFAInput.focus() + } $('#mfa-' + name + ' .input-style') .attr('name', 'code') .attr('required', true)