feat: add device loss warning tips in 2FA setup page (#7272)

#### What type of PR is this?

/area ui
/kind feature
/milestone 2.20.x

#### What this PR does / why we need it:

<img width="519" alt="image" src="https://github.com/user-attachments/assets/7c1f5636-ef85-489e-80ac-5199acf234a3" />

#### Which issue(s) this PR fixes:

Fixes #7260

#### Special notes for your reviewer:

#### Does this PR introduce a user-facing change?

```release-note
在两步验证配置界面添加设备丢失相关的提示
```
pull/7276/head
Ryan Wang 2025-03-07 14:46:59 +08:00 committed by GitHub
parent 8b4141078e
commit 577dc1ce06
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 20 additions and 6 deletions

View File

@ -350,6 +350,7 @@ core:
manual: manual:
label: If you can't scan the QR code, click to view the alternative steps. label: If you can't scan the QR code, click to view the alternative steps.
help: "Manually configure the validator application with the following code:" help: "Manually configure the validator application with the following code:"
tips: Please keep your two-step verification device safe. If the device is lost or damaged, you will not be able to log in. It is recommended that you install the authenticator app on multiple devices or keep a backup of the key in case the primary device cannot be used.
pat: pat:
operations: operations:
delete: delete:
@ -462,10 +463,6 @@ core:
revoke: revoke:
title: Revoke device title: Revoke device
description: Are you sure you want to revoke this device? After revoking, this device will be logged out description: Are you sure you want to revoke this device? After revoking, this device will be logged out
revoke_others:
title: Revoke all other devices
description: Are you sure you want to revoke all other devices? After you revoke, other devices will be logged out
toast_success: Login status of other devices has been revoked
uc_notification: uc_notification:
title: Notifications title: Notifications
tabs: tabs:

View File

@ -1254,6 +1254,12 @@ core:
help: >- help: >-
Manually configure the validator application with the Manually configure the validator application with the
following code: following code:
tips: >-
Please keep your two-step verification device safe. If the
device is lost or damaged, you will not be able to log in. It is
recommended that you install the authenticator app on multiple
devices or keep a backup of the key in case the primary device
cannot be used.
pat: pat:
operations: operations:
delete: delete:

View File

@ -1170,6 +1170,8 @@ core:
manual: manual:
label: 如果无法扫描二维码,点击查看代替步骤 label: 如果无法扫描二维码,点击查看代替步骤
help: 使用以下代码手动配置验证器应用: help: 使用以下代码手动配置验证器应用:
tips: >-
请妥善保管您的两步验证设备,如果设备丢失或损坏,你将无法登录系统。建议你在多个设备上安装验证器应用,或保存好密钥的备份,以防主要设备无法使用。
pat: pat:
operations: operations:
delete: delete:

View File

@ -1155,6 +1155,7 @@ core:
manual: manual:
label: 如果您無法掃描二維碼,請按一下查看替代步驟。 label: 如果您無法掃描二維碼,請按一下查看替代步驟。
help: 使用以下程式碼手動配置驗證器應用程式: help: 使用以下程式碼手動配置驗證器應用程式:
tips: 請妥善保管您的兩步驟驗證裝置,如果裝置遺失或損壞,您將無法登入系統。建議您在多個裝置上安裝驗證器應用程式,或保存好金鑰的備份,以防主要裝置無法使用。
pat: pat:
operations: operations:
delete: delete:

View File

@ -1,7 +1,7 @@
<script lang="ts" setup> <script lang="ts" setup>
import type { TotpRequest } from "@halo-dev/api-client"; import type { TotpRequest } from "@halo-dev/api-client";
import { ucApiClient } from "@halo-dev/api-client"; import { ucApiClient } from "@halo-dev/api-client";
import { Toast, VButton, VModal, VSpace } from "@halo-dev/components"; import { Toast, VAlert, VButton, VModal, VSpace } from "@halo-dev/components";
import { useMutation, useQuery, useQueryClient } from "@tanstack/vue-query"; import { useMutation, useQuery, useQueryClient } from "@tanstack/vue-query";
import { useQRCode } from "@vueuse/integrations/useQRCode"; import { useQRCode } from "@vueuse/integrations/useQRCode";
import { computed, ref } from "vue"; import { computed, ref } from "vue";
@ -54,7 +54,15 @@ function onSubmit(data: TotpRequest) {
@close="emit('close')" @close="emit('close')"
> >
<div> <div>
<div class="mb-4 space-y-3 border-b border-gray-100 pb-4 text-gray-900"> <VAlert
:title="$t('core.common.text.tip')"
:description="
$t('core.uc_profile.2fa.methods.totp.operations.configure.tips')
"
type="warning"
:closable="false"
></VAlert>
<div class="my-4 space-y-3 border-b border-gray-100 pb-4 text-gray-900">
<div class="text-sm font-semibold"> <div class="text-sm font-semibold">
{{ {{
$t( $t(