From 92dd661a3b8fcce932970c22330f066baec33700 Mon Sep 17 00:00:00 2001 From: fit2bot <68588906+fit2bot@users.noreply.github.com> Date: Mon, 18 Oct 2021 14:50:57 +0800 Subject: [PATCH] =?UTF-8?q?=E7=99=BB=E5=BD=95=E9=AA=8C=E8=AF=81=E5=8F=AF?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=20(#1092)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 登录验证可配置 * perf: 修改安全内容设置 * perf: 还原yarn Co-authored-by: feng626 <1304903146@qq.com> Co-authored-by: ibuler --- src/i18n/langs/cn.json | 2 +- src/views/settings/Security/PasswordRule.vue | 3 +- src/views/settings/Security/index.vue | 41 ++++++++++++++++++-- 3 files changed, 40 insertions(+), 6 deletions(-) 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