feat: 更新 API 地址,添加新的类型定义,优化表单提交逻辑
This commit is contained in:
2
.env
2
.env
@@ -1 +1 @@
|
|||||||
VITE_API_URL=http://192.168.1.54:9528
|
VITE_API_URL=http://192.168.1.36:9527
|
||||||
@@ -11,6 +11,10 @@ export type TreatyQuery<T> = T extends (...args: any[]) => any
|
|||||||
? NonNullable<NonNullable<Parameters<T>[0]>["query"]>
|
? NonNullable<NonNullable<Parameters<T>[0]>["query"]>
|
||||||
: never;
|
: never;
|
||||||
|
|
||||||
|
export type TreatyBody<T> = T extends (...args: any[]) => any
|
||||||
|
? NonNullable<Parameters<T>[0]>
|
||||||
|
: never;
|
||||||
|
|
||||||
export type DepositFiatData = Treaty.Data<typeof client.api.deposit.fiat.post>;
|
export type DepositFiatData = Treaty.Data<typeof client.api.deposit.fiat.post>;
|
||||||
|
|
||||||
export type BalancesData = Treaty.Data<typeof client.api.asset.balances.get>;
|
export type BalancesData = Treaty.Data<typeof client.api.asset.balances.get>;
|
||||||
@@ -22,17 +26,17 @@ export type WithdrawBody = Omit<Parameters<typeof client.api.withdraw.post>[0],
|
|||||||
|
|
||||||
export type UserProfileData = Treaty.Data<typeof client.api.user.profile.get>["userProfile"];
|
export type UserProfileData = Treaty.Data<typeof client.api.user.profile.get>["userProfile"];
|
||||||
|
|
||||||
export type UpdateUserProfileBody = TreatyQuery<typeof client.api.user.profile.put>;
|
export type UpdateUserProfileBody = TreatyBody<typeof client.api.user.profile.put>;
|
||||||
|
|
||||||
export type RwaIssuanceProductsData = Treaty.Data<typeof client.api.rwa.issuance.products.bundle.post>;
|
export type RwaIssuanceProductsData = Treaty.Data<typeof client.api.rwa.issuance.products.bundle.post>;
|
||||||
|
|
||||||
export type RwaIssuanceProductBody = TreatyQuery<typeof client.api.rwa.issuance.products.bundle.post>;
|
export type RwaIssuanceProductBody = TreatyBody<typeof client.api.rwa.issuance.products.bundle.post>;
|
||||||
|
|
||||||
export type RwaIssuanceCategoriesData = Treaty.Data<typeof client.api.rwa.issuance.categories.get>;
|
export type RwaIssuanceCategoriesData = Treaty.Data<typeof client.api.rwa.issuance.categories.get>;
|
||||||
|
|
||||||
export type BankAccountsData = Treaty.Data<typeof client.api.bank_account.get>;
|
export type BankAccountsData = Treaty.Data<typeof client.api.bank_account.get>;
|
||||||
|
|
||||||
export type BankAccountBody = TreatyQuery<typeof client.api.bank_account.post>;
|
export type BankAccountBody = TreatyBody<typeof client.api.bank_account.post>;
|
||||||
|
|
||||||
export type BankAccountData = Treaty.Data<typeof client.api.bank_account.post>;
|
export type BankAccountData = Treaty.Data<typeof client.api.bank_account.post>;
|
||||||
|
|
||||||
|
|||||||
@@ -106,7 +106,6 @@ function handleSubmit(values: GenericObject) {
|
|||||||
<template #default="{ field }">
|
<template #default="{ field }">
|
||||||
<ui-input-label
|
<ui-input-label
|
||||||
v-bind="field"
|
v-bind="field"
|
||||||
type="number"
|
|
||||||
inputmode="numeric"
|
inputmode="numeric"
|
||||||
:label="t('asset.issue.apply.totalSupplyLimit')"
|
:label="t('asset.issue.apply.totalSupplyLimit')"
|
||||||
:placeholder="t('asset.issue.apply.enterTotalSupplyLimit')"
|
:placeholder="t('asset.issue.apply.enterTotalSupplyLimit')"
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ function handleNext(values: GenericObject) {
|
|||||||
|
|
||||||
async function handleSubmit(editions: RwaIssuanceProductBody["editions"]) {
|
async function handleSubmit(editions: RwaIssuanceProductBody["editions"]) {
|
||||||
form.value.editions = editions;
|
form.value.editions = editions;
|
||||||
await client.api.rwa.issuance.products.bundle.post(form.value);
|
await client.api.rwa.issuance.products.bundle_and_submit.post(form.value);
|
||||||
form.value = { ...initialData };
|
form.value = { ...initialData };
|
||||||
step.value = 3;
|
step.value = 3;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,6 +45,7 @@ const schema = toTypedSchema(yup.object({
|
|||||||
}));
|
}));
|
||||||
|
|
||||||
function handleSubmit(values: GenericObject) {
|
function handleSubmit(values: GenericObject) {
|
||||||
|
debugger;
|
||||||
emit("submit", values.editions);
|
emit("submit", values.editions);
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ import { client, safeClient } from "@/api";
|
|||||||
import Category from "./components/category.vue";
|
import Category from "./components/category.vue";
|
||||||
|
|
||||||
const [query] = useResetRef<AvailableSubscriptionBody>({
|
const [query] = useResetRef<AvailableSubscriptionBody>({
|
||||||
status: "open",
|
|
||||||
pageIndex: 1,
|
pageIndex: 1,
|
||||||
pageSize: 20,
|
pageSize: 20,
|
||||||
categoryId: "",
|
categoryId: "",
|
||||||
|
|||||||
Reference in New Issue
Block a user