mirror of https://github.com/jumpserver/jumpserver
fix: 修复 mfa 登录时的 focus 错误
parent
d2df8acd84
commit
70e8a03888
|
@ -143,12 +143,16 @@ SMS_TEST_PHONE = CONFIG.SMS_TEST_PHONE
|
||||||
# Alibaba
|
# Alibaba
|
||||||
ALIBABA_ACCESS_KEY_ID = CONFIG.ALIBABA_ACCESS_KEY_ID
|
ALIBABA_ACCESS_KEY_ID = CONFIG.ALIBABA_ACCESS_KEY_ID
|
||||||
ALIBABA_ACCESS_KEY_SECRET = CONFIG.ALIBABA_ACCESS_KEY_SECRET
|
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
|
ALIBABA_SMS_SIGN_AND_TEMPLATES = CONFIG.ALIBABA_SMS_SIGN_AND_TEMPLATES
|
||||||
|
|
||||||
# TENCENT
|
# TENCENT
|
||||||
TENCENT_SECRET_ID = CONFIG.TENCENT_SECRET_ID
|
TENCENT_SECRET_ID = CONFIG.TENCENT_SECRET_ID
|
||||||
TENCENT_SECRET_KEY = CONFIG.TENCENT_SECRET_KEY
|
TENCENT_SECRET_KEY = CONFIG.TENCENT_SECRET_KEY
|
||||||
TENCENT_SDKAPPID = CONFIG.TENCENT_SDKAPPID
|
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
|
TENCENT_SMS_SIGN_AND_TEMPLATES = CONFIG.TENCENT_SMS_SIGN_AND_TEMPLATES
|
||||||
|
|
||||||
# 公告
|
# 公告
|
||||||
|
|
|
@ -75,18 +75,19 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
$('.input-style').each(function (i, ele){
|
$('.input-style').each(function (i, ele){
|
||||||
$(ele).attr('name', '')
|
$(ele).attr('name', 'code-test')
|
||||||
})
|
})
|
||||||
|
|
||||||
const currentMFAInputRef = $('#mfa-' + name + ' .input-style')
|
const currentMFAInputRef = $('#mfa-' + name + ' .input-style')
|
||||||
currentMFAInputRef.attr('name', 'code').attr('required', true)
|
currentMFAInputRef.attr('name', 'code')
|
||||||
|
|
||||||
// 登录页时,不应该默认focus
|
// 登录页时,不应该默认focus
|
||||||
const usernameRef = $('input[name="username"]')
|
const usernameRef = $('input[name="username"]')
|
||||||
if (!usernameRef || usernameRef.length === 0) {
|
if (!usernameRef || usernameRef.length === 0) {
|
||||||
|
setTimeout(() => {
|
||||||
currentMFAInputRef.focus()
|
currentMFAInputRef.focus()
|
||||||
|
})
|
||||||
}
|
}
|
||||||
currentMFAInputRef.attr('name', 'code')
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function sendChallengeCode(currentBtn) {
|
function sendChallengeCode(currentBtn) {
|
||||||
|
|
Loading…
Reference in New Issue