From 7df6d13214845a15270b8be44005caff0308c0c5 Mon Sep 17 00:00:00 2001
From: bluejay <253316343@qq.com>
Date: 星期二, 08 四月 2025 09:08:50 +0800
Subject: [PATCH] env.develop 增加VITE_APP_VERSION ,用于指导gateway进行转发

---
 src/utils/request.js |   10 ++++++----
 .env.development     |    4 ++++
 2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/.env.development b/.env.development
index af9ba00..1139b64 100644
--- a/.env.development
+++ b/.env.development
@@ -6,3 +6,7 @@
 
 # 鑻ヤ緷绠$悊绯荤粺/寮�鍙戠幆澧�
 VITE_APP_BASE_API = '/dev-api'
+
+# 鏍囪瘑鏈湴寮�鍙戞湇鍔★紝鐢ㄤ簬GateWay杞彂鍒版湰鍦版湇鍔�
+# 閰嶅悎鍚庣鏈嶅姟
+#VITE_APP_VERSION = 'zhl'
\ No newline at end of file
diff --git a/src/utils/request.js b/src/utils/request.js
index 00b910f..83f223a 100644
--- a/src/utils/request.js
+++ b/src/utils/request.js
@@ -1,10 +1,10 @@
 import axios from 'axios'
-import { ElNotification , ElMessageBox, ElMessage, ElLoading } from 'element-plus'
-import { getToken } from '@/utils/auth'
+import {ElLoading, ElMessage, ElMessageBox, ElNotification} from 'element-plus'
+import {getToken} from '@/utils/auth'
 import errorCode from '@/utils/errorCode'
-import { tansParams, blobValidate } from '@/utils/ruoyi'
+import {blobValidate, tansParams} from '@/utils/ruoyi'
 import cache from '@/plugins/cache'
-import { saveAs } from 'file-saver'
+import {saveAs} from 'file-saver'
 import useUserStore from '@/store/modules/user'
 
 let downloadLoadingInstance;
@@ -19,6 +19,7 @@
   // 瓒呮椂
   timeout: 10000
 })
+
 
 // request鎷︽埅鍣�
 service.interceptors.request.use(config => {
@@ -65,6 +66,7 @@
       }
     }
   }
+  config.headers['version'] = import.meta.env.VITE_APP_VERSION ;
   return config
 }, error => {
     console.log(error)

--
Gitblit v1.9.3