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() {
-