From 0b50a5284536658824c66224e41f1ce9d6d15422 Mon Sep 17 00:00:00 2001 From: Seven Date: Sat, 24 Jan 2026 17:23:17 +0700 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E4=BA=A4=E6=98=93?= =?UTF-8?q?=E5=AF=86=E7=A0=81=E7=8A=B6=E6=80=81=E6=A3=80=E6=9F=A5=EF=BC=8C?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BA=A4=E6=98=93=E5=AF=86=E7=A0=81=E9=AA=8C?= =?UTF-8?q?=E8=AF=81=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/exchange/index.vue | 21 ++++++++++++--------- src/views/product/components/subscribe.vue | 5 +++-- src/views/transfer/index.vue | 21 ++++++++++++--------- src/views/withdraw/index.vue | 21 ++++++++++++--------- 4 files changed, 39 insertions(+), 29 deletions(-) diff --git a/src/views/exchange/index.vue b/src/views/exchange/index.vue index bf0d698..95a4f70 100644 --- a/src/views/exchange/index.vue +++ b/src/views/exchange/index.vue @@ -10,6 +10,7 @@ const router = useRouter(); const walletStore = useWalletStore(); const { wallets } = storeToRefs(walletStore); const filterWallets = computed(() => wallets.value.filter(w => w.walletType.allowExchange === true)); +const { data: transactionPasswordStatus } = safeClient(client.api.user.security["transaction-password"].status.get()); // 兑换金额 const exchangeAmount = ref(""); @@ -137,15 +138,17 @@ async function handleSubmit() { return; } - // 验证交易密码 - if (!transactionPassword.value) { - await showToast("请输入交易密码", "warning"); - return; - } + // 验证交易密码(如果已设置) + if (transactionPasswordStatus.value?.enabled) { + if (!transactionPassword.value) { + await showToast("请输入交易密码", "warning"); + return; + } - if (transactionPassword.value.length < 6) { - await showToast("交易密码至少6位", "warning"); - return; + if (transactionPassword.value.length < 6) { + await showToast("交易密码至少6位", "warning"); + return; + } } const alert = await alertController.create({ @@ -280,7 +283,7 @@ function goToRecords() { -
+
交易密码 diff --git a/src/views/product/components/subscribe.vue b/src/views/product/components/subscribe.vue index f9ea74f..b1de342 100644 --- a/src/views/product/components/subscribe.vue +++ b/src/views/product/components/subscribe.vue @@ -15,6 +15,7 @@ const emit = defineEmits<{ }>(); const { data: product } = safeClient(() => client.api.subscription.products({ productId: props.productId }).get()); +const { data: transactionPasswordStatus } = safeClient(client.api.user.security["transaction-password"].status.get()); const paymentPassword = ref(""); const selectedWallet = ref(null); @@ -42,7 +43,7 @@ async function confirmSubscribe() { return; } - if (!paymentPassword.value) { + if (transactionPasswordStatus.value?.enabled && !paymentPassword.value) { showToast("请输入交易密码"); return; } @@ -119,7 +120,7 @@ async function confirmSubscribe() {
-
+
交易密码
diff --git a/src/views/transfer/index.vue b/src/views/transfer/index.vue index 8aa8abe..55512cc 100644 --- a/src/views/transfer/index.vue +++ b/src/views/transfer/index.vue @@ -23,6 +23,7 @@ const recipientPhone = ref(""); // 交易密码 const transactionPassword = ref(""); +const { data: transactionPasswordStatus } = safeClient(client.api.user.security["transaction-password"].status.get()); onMounted(async () => { await walletStore.syncWallets(); @@ -110,15 +111,17 @@ async function handleSubmit() { return; } - // 验证交易密码 - if (!transactionPassword.value) { - await showToast("请输入交易密码", "warning"); - return; - } + // 验证交易密码(如果已设置) + if (transactionPasswordStatus.value?.enabled) { + if (!transactionPassword.value) { + await showToast("请输入交易密码", "warning"); + return; + } - if (transactionPassword.value.length < 6) { - await showToast("交易密码至少6位", "warning"); - return; + if (transactionPassword.value.length < 6) { + await showToast("交易密码至少6位", "warning"); + return; + } } const alert = await alertController.create({ @@ -275,7 +278,7 @@ function goToRecords() {
-
+
交易密码 diff --git a/src/views/withdraw/index.vue b/src/views/withdraw/index.vue index d22913d..1f731fe 100644 --- a/src/views/withdraw/index.vue +++ b/src/views/withdraw/index.vue @@ -17,6 +17,7 @@ const selectedWallet = ref(null); const transactionPassword = ref(""); const selectedBankAccount = ref(null); const { data: bankAccounts } = await safeClient(client.api.receipt_method.get()); +const { data: transactionPasswordStatus } = safeClient(client.api.user.security["transaction-password"].status.get()); onMounted(async () => { await walletStore.syncWallets(); @@ -100,15 +101,17 @@ async function handleSubmit() { return; } - // 验证交易密码 - if (!transactionPassword.value) { - await showToast("请输入交易密码", "warning"); - return; - } + // 验证交易密码(如果已设置) + if (transactionPasswordStatus.value?.enabled) { + if (!transactionPassword.value) { + await showToast("请输入交易密码", "warning"); + return; + } - if (transactionPassword.value.length < 6) { - await showToast("交易密码至少6位", "warning"); - return; + if (transactionPassword.value.length < 6) { + await showToast("交易密码至少6位", "warning"); + return; + } } const alert = await alertController.create({ @@ -316,7 +319,7 @@ function goToRecords() {
-
+
交易密码