From 0f6b74c98096fa33a379e8756ffdae693e6f6c83 Mon Sep 17 00:00:00 2001
From: chenyc <501753378@qq.com>
Date: 星期三, 31 五月 2023 15:37:47 +0800
Subject: [PATCH] 更新环境变量

---
 .env.development   |    4 ++++
 .env.production    |    3 +++
 src/utils/axios.ts |    3 ++-
 3 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/.env.development b/.env.development
new file mode 100644
index 0000000..a822f0f
--- /dev/null
+++ b/.env.development
@@ -0,0 +1,4 @@
+`.env.development`
+// 开发环境配置
+# VITE_BASIC_API = 'https://hemobs.icoldchain.cn/'
+VITE_BASIC_API = 'http://testbs.ihemodialysis.com/'
\ No newline at end of file
diff --git a/.env.production b/.env.production
new file mode 100644
index 0000000..639c32d
--- /dev/null
+++ b/.env.production
@@ -0,0 +1,3 @@
+`.env.production`
+// 正式环境配置
+VITE_BASIC_API = 'https://hemobs.icoldchain.cn/'
\ No newline at end of file
diff --git a/src/utils/axios.ts b/src/utils/axios.ts
index b19259d..9b0b95c 100644
--- a/src/utils/axios.ts
+++ b/src/utils/axios.ts
@@ -7,8 +7,9 @@
 import { Session } from '@/utils/storage'
 
 let controllers: AbortController[] = []
+const BASE_URL = import.meta.env.VITE_BASIC_API
 
-const BASE_URL = 'https://hemobs.icoldchain.cn'
+// const BASE_URL = 'https://hemobs.icoldchain.cn'
 // const  BASE_URL='http://testbs.ihemodialysis.com'
 const TIME_OUT = 10 * 1000
 

--
Gitblit v1.8.0