From 80458848b13b739a34937c91af00105fe1d2d07a Mon Sep 17 00:00:00 2001
From: zhengyiming <540361168@qq.com>
Date: 星期二, 25 三月 2025 17:07:49 +0800
Subject: [PATCH] fix: 四期需求

---
 apps/taro/src/utils/request/index.ts |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/apps/taro/src/utils/request/index.ts b/apps/taro/src/utils/request/index.ts
index 5842e65..c2ff674 100644
--- a/apps/taro/src/utils/request/index.ts
+++ b/apps/taro/src/utils/request/index.ts
@@ -3,6 +3,7 @@
 import qs from 'qs';
 import Taro from '@tarojs/taro';
 import { getToken, Message } from '@/utils';
+import { isWeb, isWeChat } from '@/utils/env';
 import { tokenIsExpired, SensitiveManage } from '@life-payment/utils';
 import { useUserStoreWithOut } from '@/stores/modules/user';
 
@@ -23,7 +24,9 @@
 }
 
 export function endLoading() {
-  Taro.hideNavigationBarLoading();
+  if (isWeChat) {
+    Taro.hideNavigationBarLoading();
+  }
   Taro.hideLoading();
 }
 
@@ -46,7 +49,7 @@
   REDIRECT = 9,
 }
 // 涓庡悗绔害瀹氱殑鍝嶅簲鏁版嵁鏍煎紡
-interface ResponseStructure {
+export interface ResponseStructure {
   success: boolean;
   data: any;
   /**
@@ -76,7 +79,7 @@
 }
 
 const AxiosOptions: AxiosRequestConfig = {
-  baseURL: process.env.BASE_URL,
+  baseURL: isWeb ? process.env.BASE_URL_H5 : process.env.BASE_URL,
   timeout: 10 * 1000,
   headers: {
     Accept: 'application/json, text/plain, */*',
@@ -91,7 +94,7 @@
   withCredentials: true,
 };
 
-const config: RequestConfig<ResponseStructure, IRequestOptions> = {
+export const config: RequestConfig<ResponseStructure, IRequestOptions> = {
   ...AxiosOptions,
 
   errorConfig: {

--
Gitblit v1.9.1