feat: 更新 '@capp/eden' 依赖至 0.0.15,优化兑换和转账功能的 API 调用
This commit is contained in:
14
pnpm-lock.yaml
generated
14
pnpm-lock.yaml
generated
@@ -52,8 +52,8 @@ catalogs:
|
||||
specifier: 8.0.0
|
||||
version: 8.0.0
|
||||
'@capp/eden':
|
||||
specifier: http://192.168.1.2:9538/api/capp-eden-0.0.14.tgz
|
||||
version: 0.0.14
|
||||
specifier: http://192.168.1.2:9538/api/capp-eden-0.0.15.tgz
|
||||
version: 0.0.15
|
||||
'@cloudflare/workers-types':
|
||||
specifier: ^4.20260113.0
|
||||
version: 4.20260116.0
|
||||
@@ -298,7 +298,7 @@ importers:
|
||||
version: 8.0.0(@capacitor/core@8.0.0)
|
||||
'@capp/eden':
|
||||
specifier: 'catalog:'
|
||||
version: http://192.168.1.2:9538/api/capp-eden-0.0.14.tgz(@elysiajs/eden@1.4.6(elysia@1.4.22(@sinclair/typebox@0.34.47)(exact-mirror@0.2.6(@sinclair/typebox@0.34.47))(file-type@21.3.0)(openapi-types@12.1.3)(typescript@5.9.3)))
|
||||
version: http://192.168.1.2:9538/api/capp-eden-0.0.15.tgz(@elysiajs/eden@1.4.6(elysia@1.4.22(@sinclair/typebox@0.34.47)(exact-mirror@0.2.6(@sinclair/typebox@0.34.47))(file-type@21.3.0)(openapi-types@12.1.3)(typescript@5.9.3)))
|
||||
'@elysiajs/eden':
|
||||
specifier: 'catalog:'
|
||||
version: 1.4.6(elysia@1.4.22(@sinclair/typebox@0.34.47)(exact-mirror@0.2.6(@sinclair/typebox@0.34.47))(file-type@21.3.0)(openapi-types@12.1.3)(typescript@5.9.3))
|
||||
@@ -1182,9 +1182,9 @@ packages:
|
||||
'@capacitor/synapse@1.0.4':
|
||||
resolution: {integrity: sha512-/C1FUo8/OkKuAT4nCIu/34ny9siNHr9qtFezu4kxm6GY1wNFxrCFWjfYx5C1tUhVGz3fxBABegupkpjXvjCHrw==}
|
||||
|
||||
'@capp/eden@http://192.168.1.2:9538/api/capp-eden-0.0.14.tgz':
|
||||
resolution: {tarball: http://192.168.1.2:9538/api/capp-eden-0.0.14.tgz}
|
||||
version: 0.0.14
|
||||
'@capp/eden@http://192.168.1.2:9538/api/capp-eden-0.0.15.tgz':
|
||||
resolution: {tarball: http://192.168.1.2:9538/api/capp-eden-0.0.15.tgz}
|
||||
version: 0.0.15
|
||||
peerDependencies:
|
||||
'@elysiajs/eden': ^1.4.6
|
||||
|
||||
@@ -6903,7 +6903,7 @@ snapshots:
|
||||
|
||||
'@capacitor/synapse@1.0.4': {}
|
||||
|
||||
'@capp/eden@http://192.168.1.2:9538/api/capp-eden-0.0.14.tgz(@elysiajs/eden@1.4.6(elysia@1.4.22(@sinclair/typebox@0.34.47)(exact-mirror@0.2.6(@sinclair/typebox@0.34.47))(file-type@21.3.0)(openapi-types@12.1.3)(typescript@5.9.3)))':
|
||||
'@capp/eden@http://192.168.1.2:9538/api/capp-eden-0.0.15.tgz(@elysiajs/eden@1.4.6(elysia@1.4.22(@sinclair/typebox@0.34.47)(exact-mirror@0.2.6(@sinclair/typebox@0.34.47))(file-type@21.3.0)(openapi-types@12.1.3)(typescript@5.9.3)))':
|
||||
dependencies:
|
||||
'@elysiajs/eden': 1.4.6(elysia@1.4.22(@sinclair/typebox@0.34.47)(exact-mirror@0.2.6(@sinclair/typebox@0.34.47))(file-type@21.3.0)(openapi-types@12.1.3)(typescript@5.9.3))
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ catalog:
|
||||
'@capacitor/keyboard': 8.0.0
|
||||
'@capacitor/share': ^8.0.0
|
||||
'@capacitor/status-bar': 8.0.0
|
||||
'@capp/eden': http://192.168.1.2:9538/api/capp-eden-0.0.14.tgz
|
||||
'@capp/eden': http://192.168.1.2:9538/api/capp-eden-0.0.15.tgz
|
||||
'@cloudflare/workers-types': ^4.20260113.0
|
||||
'@elysiajs/eden': ^1.4.6
|
||||
'@faker-js/faker': ^10.2.0
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
<script lang='ts' setup>
|
||||
import type { Treaty } from "@elysiajs/eden";
|
||||
import type { client } from "@/api";
|
||||
import { alertController, toastController } from "@ionic/vue";
|
||||
import { checkmarkCircleOutline, documentTextOutline, keyOutline, swapHorizontalOutline, walletOutline } from "ionicons/icons";
|
||||
import { safeClient } from "@/api";
|
||||
import { client, safeClient } from "@/api";
|
||||
|
||||
type Wallet = Treaty.Data<typeof client.api.wallet.wallets.get>[number];
|
||||
|
||||
@@ -160,13 +159,12 @@ async function handleSubmit() {
|
||||
{
|
||||
text: "确认兑换",
|
||||
handler: async () => {
|
||||
// TODO: 调用兑换 API
|
||||
// const { error } = await safeClient(client.api.exchange.post({
|
||||
// fromWalletId: fromWallet.value.id,
|
||||
// toWalletId: toWallet.value.id,
|
||||
// amount,
|
||||
// transactionPassword: transactionPassword.value,
|
||||
// }));
|
||||
await safeClient(client.api.wallet_transfer.post({
|
||||
amount: amount.toString(),
|
||||
sourceWalletTypeCode: fromWallet.value?.walletType.code,
|
||||
targetWalletTypeCode: "balance",
|
||||
transactionPassword: transactionPassword.value,
|
||||
}));
|
||||
|
||||
await showToast("兑换成功");
|
||||
exchangeAmount.value = "";
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<script lang='ts' setup>
|
||||
import { alertController, toastController } from "@ionic/vue";
|
||||
import { cardOutline, checkmarkCircleOutline, documentTextOutline, logoAlipay, logoWechat, walletOutline } from "ionicons/icons";
|
||||
import { safeClient } from "@/api";
|
||||
|
||||
const walletStore = useWalletStore();
|
||||
const balanceWallet = await walletStore.getWalletByType("balance");
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
<script lang='ts' setup>
|
||||
import type { Treaty } from "@elysiajs/eden";
|
||||
import type { client } from "@/api";
|
||||
import { alertController, toastController } from "@ionic/vue";
|
||||
import { callOutline, checkmarkCircleOutline, documentTextOutline, keyOutline, personOutline, walletOutline } from "ionicons/icons";
|
||||
import { safeClient } from "@/api";
|
||||
import { client, safeClient } from "@/api";
|
||||
|
||||
type Wallet = Treaty.Data<typeof client.api.wallet.wallets.get>[number];
|
||||
|
||||
@@ -133,13 +132,12 @@ async function handleSubmit() {
|
||||
{
|
||||
text: "确认转账",
|
||||
handler: async () => {
|
||||
// TODO: 调用转账 API
|
||||
// const { error } = await safeClient(client.api.transfer.post({
|
||||
// walletId: selectedWallet.value.id,
|
||||
// amount,
|
||||
// recipientPhone: recipientPhone.value,
|
||||
// transactionPassword: transactionPassword.value,
|
||||
// }));
|
||||
await safeClient(client.api.transfer.post({
|
||||
walletTypeCode: selectedWallet.value?.walletType.code,
|
||||
amount: amount.toString(),
|
||||
targetUsername: recipientPhone.value,
|
||||
transactionPassword: transactionPassword.value,
|
||||
}));
|
||||
|
||||
await showToast("转账成功");
|
||||
transferAmount.value = "";
|
||||
|
||||
@@ -121,7 +121,6 @@ async function handleSubmit() {
|
||||
{
|
||||
text: "确认提现",
|
||||
handler: async () => {
|
||||
// TODO: 调用提现 API
|
||||
// const { error } = await safeClient(client.api.withdraw.post({
|
||||
// walletId: selectedWallet.value.id,
|
||||
// amount,
|
||||
|
||||
Reference in New Issue
Block a user