From f3dc22e4f3215c5dc49066f1907d65f6f998edf0 Mon Sep 17 00:00:00 2001
From: zhengyiming <540361168@qq.com>
Date: 星期四, 06 三月 2025 15:00:16 +0800
Subject: [PATCH] fix: 修改打包
---
packages/core/src/lifeRecharge.ts | 20 ++++++++++++--------
1 files changed, 12 insertions(+), 8 deletions(-)
diff --git a/packages/core/src/lifeRecharge.ts b/packages/core/src/lifeRecharge.ts
index ca0de2e..26c02a5 100644
--- a/packages/core/src/lifeRecharge.ts
+++ b/packages/core/src/lifeRecharge.ts
@@ -3,18 +3,18 @@
PhoneMesssageCodeLoginInput,
RequestConfig,
} from './lifeRechargeServices';
-import { IRequest, BlLifeRechargeOptions } from './types';
+import { BlLifeRechargeOptions } from './types';
import { LifeRechargeConstants } from './lifeRechargeConstants';
import { BlLifeRechargeAccountModel } from './lifeRechargeAccountModel';
-export class BlLifeRecharge<T extends IRequest = IRequest> {
- services: BlLifeRechargeServices<T>;
+export class BlLifeRecharge<TResponse = any, TRequestOptions = any> {
+ services: BlLifeRechargeServices<TResponse, TRequestOptions>;
accountModel: BlLifeRechargeAccountModel;
static constants = LifeRechargeConstants;
constants = LifeRechargeConstants;
- constructor(options: BlLifeRechargeOptions<T>) {
+ constructor(options: BlLifeRechargeOptions<TResponse, TRequestOptions>) {
this.services = new BlLifeRechargeServices(options);
this.accountModel = new BlLifeRechargeAccountModel({
userId: options.userId,
@@ -23,10 +23,14 @@
}
async login(body: PhoneMesssageCodeLoginInput, options?: RequestConfig) {
- let res = await this.services.lifePayPhoneMesssageCodeLogin(body, options);
- this.accountModel.setUserId(res);
- this.accountModel.setPhoneNumber(body.phoneNumber);
- return res;
+ try {
+ let res = await this.services.lifePayPhoneMesssageCodeLogin(body, options);
+ this.accountModel.setUserId(res);
+ this.accountModel.setPhoneNumber(body.phoneNumber);
+ return res;
+ } catch (error) {
+ throw new Error(error);
+ }
}
loginout() {
--
Gitblit v1.9.1