From c690870d5b7c28f58860a54c1c19b408057fc17c Mon Sep 17 00:00:00 2001
From: bluejay <253316343@qq.com>
Date: 星期二, 08 四月 2025 09:09:20 +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 cff5a81..7bc9f61 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