From c24cdd854e258712408a7904bdb401c49e3f07c1 Mon Sep 17 00:00:00 2001
From: zhengyiming <540361168@qq.com>
Date: 星期四, 28 八月 2025 13:09:08 +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