From e40bd17fe4ef369c9b68c0100ff1c50b9ef8729e Mon Sep 17 00:00:00 2001
From: zhengyiming <540361168@qq.com>
Date: 星期四, 06 三月 2025 14:48:28 +0800
Subject: [PATCH] fix: 修改打包
---
packages/core/src/lifeRechargeServices.ts | 106 +++++++++++++++++++++++++++++++++++++---------------
1 files changed, 75 insertions(+), 31 deletions(-)
diff --git a/packages/core/src/lifeRechargeServices.ts b/packages/core/src/lifeRechargeServices.ts
index 3a52b29..c4d1300 100644
--- a/packages/core/src/lifeRechargeServices.ts
+++ b/packages/core/src/lifeRechargeServices.ts
@@ -1,37 +1,23 @@
-import axios, { AxiosInstance, AxiosRequestConfig, AxiosResponse } from 'axios';
-import { IRequest, BlLifeRechargeServicesOptions } from './types';
+import { BlLifeRechargeServicesOptions } from './types';
import { LifeRechargeConstants } from './lifeRechargeConstants';
+import { Request, IRequest } from 'senior-request';
export interface RequestConfig {}
-export class BlLifeRechargeServices<T extends IRequest> {
- private request: 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);
- });
- });
- };
+export class BlLifeRechargeServices<TResponse = any, TRequestOptions = any> {
+ private request: IRequest;
+ constructor({ axiosConfig }: BlLifeRechargeServicesOptions<TResponse, TRequestOptions>) {
+ this.request = Request.create({
+ ...axiosConfig,
+ // baseURL: process.env.NODE_ENV === 'development' ? '/' : 'https://api.81812333.com',
+ timeout: 10 * 1000,
+ headers: {
+ Accept: 'application/json, text/plain, */*',
+ 'Content-Type': 'application/json',
+ 'X-Requested-With': 'XMLHttpRequest',
+ },
+ withCredentials: true,
+ });
}
async lifePayPhoneMesssageCodeLogin(body: PhoneMesssageCodeLoginInput, options?: RequestConfig) {
@@ -143,13 +129,40 @@
...(options || {}),
});
}
+
+ /** 鑾峰彇鐢熸椿缂磋垂鐢ㄦ埛韬唤浼氳瘽淇℃伅 GET /api/Account/GetLifePayWxIndentity */
+ async getLifePayWxIndentity(
+ // 鍙犲姞鐢熸垚鐨凱aram绫诲瀷 (闈瀊ody鍙傛暟swagger榛樿娌℃湁鐢熸垚瀵硅薄)
+ params: APIgetLifePayWxIndentityParams,
+ options?: RequestConfig
+ ) {
+ return this.request<WxMiniAppIndentityInfo>('/api/Account/GetLifePayWxIndentity', {
+ method: 'GET',
+ params: {
+ ...params,
+ },
+ ...(options || {}),
+ });
+ }
+
+ /** 鑾峰彇寰俊鏀粯鐨凧SAPI POST /api/LifePay/GetPayOrderForJsAPI */
+ async getPayOrderForJsAPI(body: GetPayOrderForJsAPIInput, options?: RequestConfig) {
+ return this.request<ModelPaymentMiniPay>('/api/LifePay/GetPayOrderForJsAPI', {
+ method: 'POST',
+ headers: {
+ 'Content-Type': 'application/json',
+ },
+ data: body,
+ ...(options || {}),
+ });
+ }
}
export interface PhoneMesssageCodeLoginInput {
/** 鎵嬫満鍙� */
phoneNumber: string;
/** 楠岃瘉鐮� */
- code: string;
+ // code: string;
}
export interface LifePayRateListOutput {
@@ -347,3 +360,34 @@
cityParentId?: string;
ciytId?: string;
}
+export interface APIgetLifePayWxIndentityParams {
+ /** 鐢ㄦ埛鐧诲綍鍑瘉 */
+ code?: string;
+}
+
+export interface WxMiniAppIndentityInfo {
+ /** 浼氳瘽瀵嗛挜 */
+ sessionKey?: string;
+ /** 灏忕▼搴廜penId */
+ openId?: string;
+ /** 鐢ㄦ埛鍚嶏紙璇ュ�间负绌哄垯闇�鎵嬫満鎺堟潈鐧诲綍锛屼笉涓虹┖鍒欏凡鏈夎灏忕▼搴忕敤鎴凤級 */
+ userName?: string;
+ unionId?: string;
+}
+
+export interface GetPayOrderForJsAPIInput {
+ orderNo: string;
+ lifePayType?: LifeRechargeConstants.LifePayTypeEnum;
+ openId?: string;
+ attach?: string;
+}
+
+export interface ModelPaymentMiniPay {
+ nonceStr?: string;
+ package?: string;
+ signType?: string;
+ paySign?: string;
+ timestamp?: string;
+ timeExpire?: string;
+ message?: string;
+}
--
Gitblit v1.9.1