zhengyiming
2025-03-03 dfb8f993f691eedc558d52347b1a93a105f6b0d2
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() {