diff --git a/src/i18n/langs/cn.json b/src/i18n/langs/cn.json index 6510b7e01..e68f0864d 100644 --- a/src/i18n/langs/cn.json +++ b/src/i18n/langs/cn.json @@ -860,7 +860,7 @@ "License": "许可证", "Senior": "高级", "LicenseFile": "许可证文件", - "PasswordCheckRule": "密码复杂度校验", + "PasswordCheckRule": "密码强弱规则", "Security": "安全设置", "SecuritySetting": "安全设置", "SystemMessageSubscription": "系统消息订阅", diff --git a/src/views/settings/Security/PasswordRule.vue b/src/views/settings/Security/PasswordRule.vue index 8584dd1f3..da73ad9a7 100644 --- a/src/views/settings/Security/PasswordRule.vue +++ b/src/views/settings/Security/PasswordRule.vue @@ -40,7 +40,8 @@ export default { visible: false, fields: [ 'SECURITY_PASSWORD_MIN_LENGTH', 'SECURITY_ADMIN_USER_PASSWORD_MIN_LENGTH', 'SECURITY_PASSWORD_UPPER_CASE', - 'SECURITY_PASSWORD_LOWER_CASE', 'SECURITY_PASSWORD_NUMBER', 'SECURITY_PASSWORD_SPECIAL_CHAR' + 'SECURITY_PASSWORD_LOWER_CASE', 'SECURITY_PASSWORD_NUMBER', 'SECURITY_PASSWORD_SPECIAL_CHAR', + 'OLD_PASSWORD_HISTORY_LIMIT_COUNT' ], successUrl: { name: 'Settings', params: { activeMenu: 'EmailContent' }}, fieldsMeta: { diff --git a/src/views/settings/Security/index.vue b/src/views/settings/Security/index.vue index 6b87a6bd0..c1ebbb3bd 100644 --- a/src/views/settings/Security/index.vue +++ b/src/views/settings/Security/index.vue @@ -40,11 +40,11 @@ export default { this.$t('common.Auth'), [ 'SECURITY_MFA_AUTH', - 'SECURITY_PASSWORD_EXPIRATION_TIME', - 'OLD_PASSWORD_HISTORY_LIMIT_COUNT', - 'SECURITY_MFA_VERIFY_TTL', + 'SECURITY_MFA_IN_LOGIN_PAGE', + 'SECURITY_LOGIN_CHALLENGE_ENABLED', 'SECURITY_LOGIN_CAPTCHA_ENABLED', - 'LOGIN_CONFIRM_ENABLE', + 'SECURITY_PASSWORD_EXPIRATION_TIME', + 'SECURITY_MFA_VERIFY_TTL', 'AuthLimit', 'PasswordRule' ] @@ -66,6 +66,39 @@ export default { title: this.$t('setting.insecureCommandEmailUpdate') } }, + SECURITY_LOGIN_CHALLENGE_ENABLED: { + on: { + change: ([val], updateForm) => { + if (val) { + updateForm({ SECURITY_MFA_IN_LOGIN_PAGE: false }) + updateForm({ SECURITY_LOGIN_CAPTCHA_ENABLED: false }) + } + } + } + }, + SECURITY_MFA_IN_LOGIN_PAGE: { + hidden: (form) => { + return form['SECURITY_MFA_AUTH'] !== 1 + }, + on: { + change: ([val], updateForm) => { + if (val) { + updateForm({ SECURITY_LOGIN_CHALLENGE_ENABLED: false }) + updateForm({ SECURITY_LOGIN_CAPTCHA_ENABLED: false }) + } + } + } + }, + SECURITY_LOGIN_CAPTCHA_ENABLED: { + on: { + change: ([val], updateForm) => { + if (val) { + updateForm({ SECURITY_LOGIN_CHALLENGE_ENABLED: false }) + updateForm({ SECURITY_MFA_IN_LOGIN_PAGE: false }) + } + } + } + }, LOGIN_CONFIRM_ENABLE: { hidden: () => { return !this.$store.getters.hasValidLicense