From 84fc6b2ffb0a04731a22ab0570dc719fb4747c17 Mon Sep 17 00:00:00 2001 From: MaysWind Date: Wed, 22 Jan 2025 21:47:00 +0800 Subject: [PATCH] migrate user 2fa setting page to composition API and typescript --- .../tabs/UserTwoFactorAuthSettingTab.vue | 456 +++++++++--------- src/views/mobile/users/TwoFactorAuthPage.vue | 361 +++++++------- 2 files changed, 409 insertions(+), 408 deletions(-) diff --git a/src/views/desktop/user/settings/tabs/UserTwoFactorAuthSettingTab.vue b/src/views/desktop/user/settings/tabs/UserTwoFactorAuthSettingTab.vue index 25196a88..4a314a8d 100644 --- a/src/views/desktop/user/settings/tabs/UserTwoFactorAuthSettingTab.vue +++ b/src/views/desktop/user/settings/tabs/UserTwoFactorAuthSettingTab.vue @@ -3,20 +3,20 @@

- {{ status === true ? $t('Two-factor authentication is already enabled.') : $t('Two-factor authentication is not enabled yet.') }} + {{ status === true ? tt('Two-factor authentication is already enabled.') : tt('Two-factor authentication is not enabled yet.') }}

- {{ $t('Please use a two-factor authentication app to scan the qrcode below and enter the current passcode.') }} + {{ tt('Please use a two-factor authentication app to scan the qrcode below and enter the current passcode.') }}

- {{ $t('Your current password is required to disable two-factor authentication or regenerate backup codes for two-factor authentication. If you regenerate backup codes, the previous ones will become invalid.') }} + {{ tt('Your current password is required to disable two-factor authentication or regenerate backup codes for two-factor authentication. If you regenerate backup codes, the previous ones will become invalid.') }}

@@ -29,7 +29,7 @@ autocomplete="one-time-code" variant="underlined" :disabled="loading || enabling || enableConfirming || disabling" - :placeholder="$t('Passcode')" + :placeholder="tt('Passcode')" v-model="currentPasscode" @keyup.enter="enableConfirm" /> @@ -45,7 +45,7 @@ type="password" variant="underlined" :disabled="loading || enabling || enableConfirming || disabling" - :placeholder="$t('Current Password')" + :placeholder="tt('Current Password')" v-model="currentPassword" />
@@ -56,19 +56,19 @@ - {{ $t('Disable Two-Factor Authentication') }} + {{ tt('Disable Two-Factor Authentication') }} - {{ $t('Regenerate Backup Codes') }} + {{ tt('Regenerate Backup Codes') }} - {{ $t('Enable Two-Factor Authentication') }} + {{ tt('Enable Two-Factor Authentication') }} - {{ $t('Continue') }} + {{ tt('Continue') }} @@ -80,18 +80,18 @@

- {{ $t('Please copy these backup codes to safe place, the following backup codes will be displayed only once. If these codes were lost, you can regenerate them at any time.') }} + {{ tt('Please copy these backup codes to safe place, the following backup codes will be displayed only once. If these codes were lost, you can regenerate them at any time.') }}

@@ -102,8 +102,13 @@ -