fix fix fix

This commit is contained in:
2026-06-27 17:07:02 +08:00
parent 7cbf86c42c
commit 3dab895aed
5 changed files with 82 additions and 39 deletions
+6 -6
View File
@@ -100,33 +100,33 @@ class Api {
return this.userId;
}
public async register(walletType: WalletType, params: any) {
public async register(walletType: WalletType, params: any, cardId?: string) {
const res = await fetch(`${Api.BASE_URL}/register`, {
method: 'POST',
headers: this.headers(),
body: JSON.stringify({ walletType, params }),
body: JSON.stringify({ walletType, params, cardId }),
});
const data = await res.json();
if (!data.success) throw new Error(data.message);
return data;
}
public async requestOTP(walletType: WalletType, mobile: string, params: any = {}) {
public async requestOTP(walletType: WalletType, mobile: string, params: any = {}, cardId?: string) {
const res = await fetch(`${Api.BASE_URL}/request-otp`, {
method: 'POST',
headers: this.headers(),
body: JSON.stringify({ walletType, mobile, params }),
body: JSON.stringify({ walletType, mobile, params, cardId }),
});
const data = await res.json();
if (!data.success) throw new Error(data.message);
return data;
}
public async verifyOTP(walletType: WalletType, mobile: string, otp: string, params: any = {}) {
public async verifyOTP(walletType: WalletType, mobile: string, otp: string, params: any = {}, cardId?: string) {
const res = await fetch(`${Api.BASE_URL}/verify-otp`, {
method: 'POST',
headers: this.headers(),
body: JSON.stringify({ walletType, mobile, otp, params }),
body: JSON.stringify({ walletType, mobile, otp, params, cardId }),
});
const data = await res.json();
if (!data.success) throw new Error(data.message);