From 915424730f27445da2e8de13b62e77179cc1a15a Mon Sep 17 00:00:00 2001
From: zhengyiming <540361168@qq.com>
Date: 星期一, 18 八月 2025 17:07:39 +0800
Subject: [PATCH] fix: 关闭移动充值渠道,打开电信充值渠道
---
apps/taro/src/utils/request/index.ts | 21 ++++++++++++++++++++-
1 files changed, 20 insertions(+), 1 deletions(-)
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,
+ });
+}
--
Gitblit v1.9.1