From 337124ca820f5f5e7259508e0141e0b7a7b7da08 Mon Sep 17 00:00:00 2001 From: wxg0103 <727495428@qq.com> Date: Wed, 17 Dec 2025 09:51:49 +0800 Subject: [PATCH] feat: enhance user settings with additional failed attempts and lock time configurations --- ui/src/locales/lang/en-US/views/system.ts | 2 + ui/src/locales/lang/zh-CN/views/system.ts | 2 + ui/src/locales/lang/zh-Hant/views/system.ts | 2 + .../embed/component/ChatHistoryDrawer.vue | 1 - .../mobile/component/UserCenterDrawer.vue | 1 - ui/src/views/chat/pc/index.vue | 1 - .../authentication/component/Setting.vue | 63 +++++++++++++++---- 7 files changed, 58 insertions(+), 14 deletions(-) diff --git a/ui/src/locales/lang/en-US/views/system.ts b/ui/src/locales/lang/en-US/views/system.ts index c6e23907a..76df36aa1 100644 --- a/ui/src/locales/lang/en-US/views/system.ts +++ b/ui/src/locales/lang/en-US/views/system.ts @@ -157,4 +157,6 @@ export default { display_codeTip: 'When the value is -1, the verification code is not displayed', time: 'Times', setting: 'Login Setting', + failedTip: 'Next, lock the account', + minute: 'Minutes', } diff --git a/ui/src/locales/lang/zh-CN/views/system.ts b/ui/src/locales/lang/zh-CN/views/system.ts index 629242405..29f29fed7 100644 --- a/ui/src/locales/lang/zh-CN/views/system.ts +++ b/ui/src/locales/lang/zh-CN/views/system.ts @@ -155,6 +155,8 @@ export default { display_code: '账号登录验证码设置', loginFailed: '登录失败', loginFailedMessage: '次显示验证码', + failedTip: '次,锁定账号', + minute: '分钟', display_codeTip: '值为-1时,不显示验证码', time: '次', setting: '登录设置', diff --git a/ui/src/locales/lang/zh-Hant/views/system.ts b/ui/src/locales/lang/zh-Hant/views/system.ts index 35282b574..c52a919a9 100644 --- a/ui/src/locales/lang/zh-Hant/views/system.ts +++ b/ui/src/locales/lang/zh-Hant/views/system.ts @@ -156,6 +156,8 @@ export default { loginFailed: '登入失敗', loginFailedMessage: '次顯示驗證碼', display_codeTip: '值為-1時,不顯示驗證碼', + failedTip: '次,鎖定帳號', + minute: '分鐘', time: '次', setting: '登录設置', } diff --git a/ui/src/views/chat/embed/component/ChatHistoryDrawer.vue b/ui/src/views/chat/embed/component/ChatHistoryDrawer.vue index 51fc00e5f..49dddb477 100644 --- a/ui/src/views/chat/embed/component/ChatHistoryDrawer.vue +++ b/ui/src/views/chat/embed/component/ChatHistoryDrawer.vue @@ -67,7 +67,6 @@ {{ $t('views.login.resetPassword') }}
diff --git a/ui/src/views/chat/pc/index.vue b/ui/src/views/chat/pc/index.vue index bae5b8688..14fbc67f9 100644 --- a/ui/src/views/chat/pc/index.vue +++ b/ui/src/views/chat/pc/index.vue @@ -78,7 +78,6 @@ {{ $t('views.login.resetPassword') }} - + + + {{ $t('views.system.loginFailed') }} - - + + {{ $t('views.system.loginFailedMessage') }} - + ({{ $t('views.system.display_codeTip') }}) + + + + + {{ $t('views.system.loginFailed') }} + + + + {{ $t('views.system.loginFailedMessage') }} + + + + 分钟 + + + +
@@ -93,6 +126,8 @@ const authFormRef = ref(); const form = ref({ default_value: 'LOCAL', max_attempts: 1, + failed_attempts: 5, + lock_time: 10, }) const submit = async (formEl: FormInstance | undefined) => { @@ -117,6 +152,12 @@ onMounted(() => { authApi.getLoginSetting().then((res) => { if (Object.keys(res.data).length > 0) { form.value = res.data; + if (!form.value.failed_attempts) { + form.value.failed_attempts = 5; + } + if (!form.value.lock_time) { + form.value.lock_time = 10; + } loginMethods.value = res.data.auth_types } })