From 91f00f1df35a964d69f48b9f71b484e2d4ef357e Mon Sep 17 00:00:00 2001
From: zhengyiming <540361168@qq.com>
Date: 星期三, 11 六月 2025 16:52:57 +0800
Subject: [PATCH] fix: v1.4

---
 apps/taro/src/utils/request/index.ts             |   21 ++++++
 apps/taro/package.json                           |    2 
 packages/core/src/lifeRechargeAccountModel.ts    |    6 +
 packages/services/api/typings.d.ts               |   11 +++
 apps/taro/src/hooks/user.ts                      |    4 
 packages/services/api/Log.ts                     |   15 +++++
 packages/services/api/index.ts                   |    2 
 packages/components/src/views/Mine/Dashboard.vue |   13 +++-
 packages/core/src/lifeRechargeServices.ts        |    2 
 packages/services/api/LifePay.ts                 |   15 +++++
 pnpm-lock.yaml                                   |   40 ++++++++-----
 11 files changed, 106 insertions(+), 25 deletions(-)

diff --git a/apps/taro/package.json b/apps/taro/package.json
index e607694..ef3c3a3 100644
--- a/apps/taro/package.json
+++ b/apps/taro/package.json
@@ -77,7 +77,7 @@
     "qrcode.vue": "^3.6.0",
     "qs": "^6.11.1",
     "senin-mini": "^1.0.10",
-    "senior-request": "^1.0.3",
+    "senior-request": "^1.0.5",
     "taro-plugin-pinia": "^1.0.0",
     "vconsole": "^3.15.1",
     "vue": "3.5.12",
diff --git a/apps/taro/src/hooks/user.ts b/apps/taro/src/hooks/user.ts
index ed8986e..0125a2e 100644
--- a/apps/taro/src/hooks/user.ts
+++ b/apps/taro/src/hooks/user.ts
@@ -174,12 +174,12 @@
   const { wxCode, wxOpenId } = useUser();
   const { getLifePayWxIndentity } = useLifePayWxIndentity();
 
-  async function ensureOpenId() {
+  async function ensureOpenId(): Promise<string> {
     if (wxOpenId.value) {
       return wxOpenId.value;
     } else {
       let rea = await getLifePayWxIndentity(wxCode.value);
-      return rea.openId ? rea.openId : wxOpenId.value;
+      return rea.openId ? rea.openId : await ensureOpenId();
     }
   }
 
diff --git a/apps/taro/src/utils/request/index.ts b/apps/taro/src/utils/request/index.ts
index c2ff674..cae3512 100644
--- a/apps/taro/src/utils/request/index.ts
+++ b/apps/taro/src/utils/request/index.ts
@@ -1,5 +1,5 @@
 import { type IRequestOptions, Request, type RequestConfig } from 'senior-request';
-import { type AxiosRequestConfig, type AxiosError } from 'axios';
+import axios, { type AxiosRequestConfig, type AxiosError } from 'axios';
 import qs from 'qs';
 import Taro from '@tarojs/taro';
 import { getToken, Message } from '@/utils';
@@ -101,6 +101,13 @@
     // 閿欒鎺ユ敹鍙婂鐞�
     errorHandler: (error, opts) => {
       console.log('error: ', error);
+      const userStore = useUserStoreWithOut();
+      logFront({
+        url: opts.url,
+        message: JSON.stringify(error),
+        requestTime: new Date().toLocaleString(),
+        userId: userStore.virtualUserId,
+      });
       if (opts?.skipErrorHandler) throw error;
 
       if (opts?.customErrorHandler) {
@@ -289,3 +296,15 @@
 }
 
 export const request = Request.create(config);
+
+function logFront(body: API.LogFrontInput) {
+  return axios.request({
+    baseURL: AxiosOptions.baseURL,
+    url: '/api/Log/LogFront',
+    method: 'POST',
+    headers: {
+      'Content-Type': 'application/json',
+    },
+    data: body,
+  });
+}
diff --git a/packages/components/src/views/Mine/Dashboard.vue b/packages/components/src/views/Mine/Dashboard.vue
index 3d624ad..fcf6639 100644
--- a/packages/components/src/views/Mine/Dashboard.vue
+++ b/packages/components/src/views/Mine/Dashboard.vue
@@ -29,7 +29,7 @@
         <DashboardItem
           title="绱鏀剁泭"
           :icon="IconDashboard5"
-          :value="toThousand(topStatistics?.accumulatedIncome ?? 0)"
+          :value="toThousand(topStatistics?.accumulatedChannlesRakePrice ?? 0)"
           need-symbol
         />
         <DashboardItem
@@ -80,7 +80,10 @@
 const { blLifeRecharge } = useLifeRechargeContext();
 
 const { data: topStatistics } = useQuery({
-  queryKey: ['lifePayServices/getTopStatistics', blLifeRecharge.accountModel.userChannles],
+  queryKey: [
+    'lifePayServices/getTopStatistics',
+    computed(() => blLifeRecharge.accountModel.userChannles),
+  ],
   queryFn: async () => {
     return await blLifeRecharge.services.getTopStatistics(
       {
@@ -92,6 +95,10 @@
     );
   },
   placeholderData: () => ({} as TopStatisticsOutput),
-  enabled: computed(() => blLifeRecharge.accountModel.isBackClientUser),
+  enabled: computed(() => {
+    return (
+      !!blLifeRecharge.accountModel.isBackClientUser && blLifeRecharge.accountModel.isGetUserInfo
+    );
+  }),
 });
 </script>
diff --git a/packages/core/src/lifeRechargeAccountModel.ts b/packages/core/src/lifeRechargeAccountModel.ts
index 001eebc..952fec3 100644
--- a/packages/core/src/lifeRechargeAccountModel.ts
+++ b/packages/core/src/lifeRechargeAccountModel.ts
@@ -13,6 +13,7 @@
   /**鐢ㄦ埛鎵�鏈夌殑娓犻亾 */
   userChannles = [] as ChannelOutput[];
   isBackClientUser: boolean;
+  isGetUserInfo = false;
 
   constructor(
     ctx: BlLifeRecharge<TResponse, TRequestOptions>,
@@ -43,11 +44,12 @@
           showLoading: false,
         }
       );
-      this.isBackClientUser = res.isBackClientUser;
-      this.promoterIdNumber = res.promoterIdNumber;
       if (res && res.isBackClientUser) {
         this.setUserChannles(res.channlesNum ?? []);
       }
+      this.isBackClientUser = res.isBackClientUser;
+      this.promoterIdNumber = res.promoterIdNumber;
+      this.isGetUserInfo = true;
       return res;
     } catch (error) {
       console.log('error: ', error);
diff --git a/packages/core/src/lifeRechargeServices.ts b/packages/core/src/lifeRechargeServices.ts
index df6f873..41e981e 100644
--- a/packages/core/src/lifeRechargeServices.ts
+++ b/packages/core/src/lifeRechargeServices.ts
@@ -962,6 +962,8 @@
   accumulatedUsers?: number;
   /** 鏄ㄦ棩娲昏穬鐢ㄦ埛 */
   yesterdayActiveUsers?: number;
+  /** 绱浣i噾 */
+  accumulatedChannlesRakePrice?: number;
 }
 
 export interface QueryLifePayChannlesInput {
diff --git a/packages/services/api/LifePay.ts b/packages/services/api/LifePay.ts
index 8efe49c..f134942 100644
--- a/packages/services/api/LifePay.ts
+++ b/packages/services/api/LifePay.ts
@@ -482,6 +482,21 @@
   });
 }
 
+/** 瀵煎嚭娓犻亾璁㈠崟Excel POST /api/LifePay/GetLifePayOrderPageExportForChannle */
+export async function getLifePayOrderPageExportForChannle(
+  body: API.QueryLifePayOrderListInput,
+  options?: API.RequestConfig
+) {
+  return request<any>('/api/LifePay/GetLifePayOrderPageExportForChannle', {
+    method: 'POST',
+    headers: {
+      'Content-Type': 'application/json',
+    },
+    data: body,
+    ...(options || {}),
+  });
+}
+
 /** 鑾峰彇鍏呭�兼祦姘村垎椤垫暟鎹� POST /api/LifePay/GetLifePayRechargeReceiptsPage */
 export async function getLifePayRechargeReceiptsPage(
   body: API.LifePayRechargeReceiptsPageInput,
diff --git a/packages/services/api/Log.ts b/packages/services/api/Log.ts
new file mode 100644
index 0000000..2832c1e
--- /dev/null
+++ b/packages/services/api/Log.ts
@@ -0,0 +1,15 @@
+/* eslint-disable */
+// @ts-ignore
+import { request } from '@/utils/request';
+
+/** 璁板綍鍓嶇鏃ュ織 POST /api/Log/LogFront */
+export async function logFront(body: API.LogFrontInput, options?: API.RequestConfig) {
+  return request<any>('/api/Log/LogFront', {
+    method: 'POST',
+    headers: {
+      'Content-Type': 'application/json',
+    },
+    data: body,
+    ...(options || {}),
+  });
+}
diff --git a/packages/services/api/index.ts b/packages/services/api/index.ts
index 3f1adbc..8bc1a3d 100644
--- a/packages/services/api/index.ts
+++ b/packages/services/api/index.ts
@@ -14,6 +14,7 @@
 import * as IdentityUser from './IdentityUser';
 import * as IdentityUserLookup from './IdentityUserLookup';
 import * as LifePay from './LifePay';
+import * as Log from './Log';
 import * as OperateHistory from './OperateHistory';
 import * as Permissions from './Permissions';
 import * as PhoneMessage from './PhoneMessage';
@@ -37,6 +38,7 @@
   IdentityUser,
   IdentityUserLookup,
   LifePay,
+  Log,
   OperateHistory,
   Permissions,
   PhoneMessage,
diff --git a/packages/services/api/typings.d.ts b/packages/services/api/typings.d.ts
index 4225410..6640eab 100644
--- a/packages/services/api/typings.d.ts
+++ b/packages/services/api/typings.d.ts
@@ -1473,6 +1473,8 @@
     lifePayType?: LifePayTypeEnum;
     /** 娓犻亾鍚嶇О */
     channelName?: string;
+    /** 杩愯惀鍟� */
+    operator?: string;
     lifePayOrderType?: LifePayOrderTypeEnum;
     /** 璁㈠崟鍙� */
     orderNo?: string;
@@ -1514,6 +1516,8 @@
     acoolyOrderNo?: string;
     acoolyStatus?: ACOOLYStatusEnum;
     lifePayRefundStatus?: LifePayRefundStatusEnum;
+    /** 璁㈠崟鍙傛暟璇︽儏 */
+    orderParamDetailJsonStr?: string;
     /** 瀹為檯鍒拌处閲戦 */
     actualReceivedAmount?: number;
     actualReceivedStatus?: LifePayStatusEnum;
@@ -1773,6 +1777,13 @@
     error?: string;
   }
 
+  interface LogFrontInput {
+    userId?: string;
+    message?: string;
+    url?: string;
+    requestTime?: string;
+  }
+
   interface MethodParameterApiDescriptionModel {
     name?: string;
     typeAsString?: string;
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index b9b1708..ff1d0b5 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -601,8 +601,8 @@
         specifier: ^1.0.10
         version: 1.0.12(@nutui/icons-vue-taro@0.0.9)(@nutui/nutui-taro@4.3.13)(@tanstack/vue-query@4.37.1)(@tarojs/components@3.6.20)(@tarojs/taro@3.6.20)(axios@1.7.7)(dayjs@1.11.13)(lodash@4.17.21)(vue@3.5.12)
       senior-request:
-        specifier: ^1.0.3
-        version: 1.0.4(axios@1.7.7)
+        specifier: ^1.0.5
+        version: 1.0.5(axios@1.7.7)
       taro-plugin-pinia:
         specifier: ^1.0.0
         version: 1.0.0
@@ -9520,8 +9520,8 @@
       - whiskers
     dev: true
 
-  /@tencentcloud/call-engine-js@3.0.1:
-    resolution: {integrity: sha512-OafM512KDbk4b9dpVVymLvuQuoVNqp7ZQmnZVjDmC5v/bQxA1FSUaAinty+7AU1Fb1FxQwxuHKDPysQAU+9M0g==}
+  /@tencentcloud/call-engine-js@3.1.0:
+    resolution: {integrity: sha512-ygbGO+NDsqVoF4ud4bAto4zLzqC6CYSJ1lvkoMsRHdaTeXi2M4qrcAqbqbrFD9L8VjLTsbw1o2MzbQCQfYnv3g==}
     dependencies:
       '@tencentcloud/chat': 3.5.5
       core-js: 3.41.0
@@ -9542,10 +9542,10 @@
       - vue
     dev: false
 
-  /@tencentcloud/call-uikit-vue2.6@4.0.6(vue@3.5.12):
-    resolution: {integrity: sha512-As0qoW6TncyZ0y10Ogm6KrziZGznM5DX5HBPdYfZDbDm6eIYxG13HD3K8BzUC/GRlny8Nxn4EfhSkn48StBruQ==}
+  /@tencentcloud/call-uikit-vue2.6@4.0.7(vue@3.5.12):
+    resolution: {integrity: sha512-w3EankGnt74+S6rDrsVsLY/sRm+R4PtnHQEKHiJyySOGUKlgthq8/gOh2Lee03mh3+Yd6gRivOnEmlBbVNEmQA==}
     dependencies:
-      '@tencentcloud/call-engine-js': 3.0.1
+      '@tencentcloud/call-engine-js': 3.1.0
       '@tencentcloud/chat': 3.5.5
       '@tencentcloud/tui-core': 2.4.0
       '@vue/composition-api': 1.7.2(vue@3.5.12)
@@ -9561,10 +9561,10 @@
       tuicall-engine-webrtc: 3.1.6
     dev: false
 
-  /@tencentcloud/call-uikit-vue2@4.0.6:
-    resolution: {integrity: sha512-egV/rS0T77vj3+d3YpurJxynFBJ41hbBO8WPmwc5z9BD2qjM2HSKgbMR2jGF6XAxjherCK/qlaIZLQQiNIKmNQ==}
+  /@tencentcloud/call-uikit-vue2@4.0.7:
+    resolution: {integrity: sha512-EzLrlzOgAnIY+aSVT2if06D0ebPgqIXTcVQuY+xj6NQI+PTpfkRu/SAlC50CHuaGOdH7F5P+U32dCOjcCoS4BQ==}
     dependencies:
-      '@tencentcloud/call-engine-js': 3.0.1
+      '@tencentcloud/call-engine-js': 3.1.0
       '@tencentcloud/chat': 3.5.5
       '@tencentcloud/tui-core': 2.4.0
     dev: false
@@ -9577,10 +9577,10 @@
       tuicall-engine-webrtc: 3.1.6
     dev: false
 
-  /@tencentcloud/call-uikit-vue@4.0.6:
-    resolution: {integrity: sha512-eqcIv2QcsH1iRdpbBJu6sv73wVMzaeb4Bap5A2B+uVJrnrwEd1KwOzk8wV4gNIbtF08fK933R4OnkuCRMhoH4A==}
+  /@tencentcloud/call-uikit-vue@4.0.7:
+    resolution: {integrity: sha512-FGaCeCOAyk0z/qiobT+d9F1RFKLal1/lhk51pDso38MlJbvhzk7/s/feubO1Fbi5nHqRBF71m7+RS44m/Fcspg==}
     dependencies:
-      '@tencentcloud/call-engine-js': 3.0.1
+      '@tencentcloud/call-engine-js': 3.1.0
       '@tencentcloud/chat': 3.5.5
       '@tencentcloud/tui-core': 2.4.0
     dev: false
@@ -9614,9 +9614,9 @@
       '@tiptap/pm': ^2.0.0-beta.220
       '@tiptap/suggestion': ^2.0.0-beta.220
     dependencies:
-      '@tencentcloud/call-uikit-vue': 4.0.6
-      '@tencentcloud/call-uikit-vue2': 4.0.6
-      '@tencentcloud/call-uikit-vue2.6': 4.0.6(vue@3.5.12)
+      '@tencentcloud/call-uikit-vue': 4.0.7
+      '@tencentcloud/call-uikit-vue2': 4.0.7
+      '@tencentcloud/call-uikit-vue2.6': 4.0.7(vue@3.5.12)
       '@tencentcloud/chat-uikit-engine': 2.4.4
       '@tencentcloud/roomkit-web-vue3': 3.0.0(pinia@2.3.1)(typescript@4.9.5)(vue@3.5.12)
       '@tencentcloud/tui-core': 2.4.0
@@ -27356,6 +27356,14 @@
       axios: 1.7.7
     dev: false
 
+  /senior-request@1.0.5(axios@1.7.7):
+    resolution: {integrity: sha512-4o7p4uuP2w20atTCYsP+9aQr3VMMKyMLO/urRZAVfFepgH5cUcHRO4ZFprpXKqkPKrF3QjrNPY4Vk8Y3CIRovg==}
+    peerDependencies:
+      axios: '*'
+    dependencies:
+      axios: 1.7.7
+    dev: false
+
   /sentence-case@3.0.4:
     resolution: {integrity: sha512-8LS0JInaQMCRoQ7YUytAo/xUu5W2XnQxV2HI/6uM6U7CITS1RqPElr30V6uIqyMKM9lJGRVFy5/4CuzcixNYSg==}
     dependencies:

--
Gitblit v1.9.1