From e53e33dd46fdf138c851b10f12cdc00131a8d644 Mon Sep 17 00:00:00 2001
From: wupengfei <834520024@qq.com>
Date: 星期二, 25 二月 2025 17:12:44 +0800
Subject: [PATCH] fix: bug

---
 packages/core/src/lifeRechargeServices.ts |   65 ++++++++++++++++++++++++++++++++
 1 files changed, 64 insertions(+), 1 deletions(-)

diff --git a/packages/core/src/lifeRechargeServices.ts b/packages/core/src/lifeRechargeServices.ts
index 753b3b0..3a52b29 100644
--- a/packages/core/src/lifeRechargeServices.ts
+++ b/packages/core/src/lifeRechargeServices.ts
@@ -6,8 +6,32 @@
 
 export class BlLifeRechargeServices<T extends IRequest> {
   private request: T;
-  constructor({ request }: BlLifeRechargeServicesOptions<T>) {
+  request2: T;
+  constructor({ request, axiosOptions }: BlLifeRechargeServicesOptions<T>) {
     this.request = request;
+    const axiosInstance = axios.create(axiosOptions);
+    // @ts-expect-error
+    this.request2 = (url: string, opts: any = { method: 'GET' }) => {
+      return new Promise((resolve, reject) => {
+        axiosInstance
+          .request({ ...opts, url })
+          .then((res) => {
+            //@ts-ignore
+            resolve(res);
+          })
+          .catch((error) => {
+            try {
+              // const handler = config?.errorConfig?.errorHandler;
+              // if (handler) {
+              //   handler(error, opts, config);
+              // }
+            } catch (e) {
+              reject(e);
+            }
+            reject(error);
+          });
+      });
+    };
   }
 
   async lifePayPhoneMesssageCodeLogin(body: PhoneMesssageCodeLoginInput, options?: RequestConfig) {
@@ -24,6 +48,14 @@
   /** 鑾峰彇鎶樻墸 GET /api/LifePay/GetRate */
   async getRate(options?: RequestConfig) {
     return this.request<LifePayRateListOutput[]>('/api/LifePay/GetRate', {
+      method: 'GET',
+      ...(options || {}),
+    });
+  }
+
+  /** 鑾峰彇鐢佃垂鍏呭�煎尯鍩� GET /api/LifePay/GetElectricSupportArea */
+  async getElectricSupportArea(options?: RequestConfig) {
+    return this.request<ElectricSupportAreaResponse>('/api/LifePay/GetElectricSupportArea', {
       method: 'GET',
       ...(options || {}),
     });
@@ -284,3 +316,34 @@
   /** 閫�娆炬椂闂� */
   refundTime?: string;
 }
+
+export interface ElectricSupportAreaResponse {
+  success?: boolean;
+  requestNo?: string;
+  partnerId?: string;
+  service?: string;
+  version?: string;
+  protocol?: string;
+  context?: string;
+  ext?: any;
+  code?: string;
+  message?: string;
+  detail?: string;
+  electricAreaList?: ElectricSupportAreaListOutput[];
+}
+
+export interface ElectricSupportAreaListOutput {
+  childCityList?: ElectricSupportAreaChildCityListOutput[];
+  cityName?: string;
+  cityParentId?: string;
+  ciytId?: string;
+  electricType?: string;
+  parValue?: string[];
+  rate?: number;
+}
+
+export interface ElectricSupportAreaChildCityListOutput {
+  cityName?: string;
+  cityParentId?: string;
+  ciytId?: string;
+}

--
Gitblit v1.9.1