From bea752879cf78437369db1a8f6940aa55873c833 Mon Sep 17 00:00:00 2001 From: PKC278 <52959804+PKC278@users.noreply.github.com> Date: Tue, 20 Jan 2026 00:34:33 +0800 Subject: [PATCH] =?UTF-8?q?feat(passkey):=20=E6=B7=BB=E5=8A=A0=E7=8E=AF?= =?UTF-8?q?=E5=A2=83=E5=8F=98=E9=87=8F=E9=85=8D=E7=BD=AE=E9=A1=B9=EF=BC=8C?= =?UTF-8?q?=E5=85=81=E8=AE=B8=E6=B3=A8=E5=86=8Cpasskey=E6=97=B6=E8=B7=B3?= =?UTF-8?q?=E8=BF=87=E9=AA=8C=E8=AF=81=E6=98=AF=E5=90=A6=E5=B7=B2=E6=B3=A8?= =?UTF-8?q?=E5=86=8Cotp?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/dialog/PasskeyDialog.vue | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/components/dialog/PasskeyDialog.vue b/src/components/dialog/PasskeyDialog.vue index 90c6c656..756d9bc5 100644 --- a/src/components/dialog/PasskeyDialog.vue +++ b/src/components/dialog/PasskeyDialog.vue @@ -6,6 +6,7 @@ import { useI18n } from 'vue-i18n' import { formatDateDifference } from '@core/utils/formatters' import api from '@/api' import type { ApiResponse, PassKey } from '@/api/types' +import { useGlobalSettingsStore } from '@/stores' interface Props { modelValue: boolean @@ -26,6 +27,7 @@ const emit = defineEmits(['update:modelValue', 'update:passkeyList', 'verifyPass const { t, locale } = useI18n() const display = useDisplay() const $toast = useToast() +const globalSettingsStore = useGlobalSettingsStore() // 内部状态 const show = computed({ @@ -45,6 +47,9 @@ const passkeyName = ref('') // PassKey challenge const passkeyChallenge = ref('') +const allowPasskeyWithoutOtp = computed(() => !!globalSettingsStore.get('PASSKEY_ALLOW_REGISTER_WITHOUT_OTP')) +const canRegisterPasskey = computed(() => props.isOtp || allowPasskeyWithoutOtp.value) + // 格式化日期 function formatDate(dateStr: string) { return new Date(dateStr).toLocaleDateString(locale.value) @@ -230,7 +235,7 @@ watch( - +
{{ t('profile.registerNewPasskey') }}

{{ t('profile.passkeyDescription') }}