From 277ef1f7f45ffe9c91194315dbcc2508ae008668 Mon Sep 17 00:00:00 2001
From: husq <931347610@qq.com>
Date: Wed, 11 Oct 2023 16:22:30 +0800
Subject: [PATCH] 环境变量配置修改

---
 src/components/GMap.vue |   16 ++++++++++++++++
 src/api/http/request.ts |    1 -
 vite.config.ts          |    2 +-
 env/.env.stag           |    2 +-
 env/.env.dev            |    2 +-
 env/.env.production     |    2 +-
 env/.env                |    2 +-
 7 files changed, 21 insertions(+), 6 deletions(-)

diff --git a/env/.env b/env/.env
index 69a2c7a..d0c1d2a 100644
--- a/env/.env
+++ b/env/.env
@@ -1,3 +1,3 @@
 VITE_API_URL = 'http://192.168.1.133:6789'
 VITE_WS_API_URL = 'ws://192.168.1.133:6789/api/v1/ws'
-VITE_BASE_API = '/uav'
+VITE_BASE_API = '/drone-api'
diff --git a/env/.env.dev b/env/.env.dev
index 4f8d435..629bab3 100644
--- a/env/.env.dev
+++ b/env/.env.dev
@@ -1,4 +1,4 @@
 VITE_API_URL = 'http://192.168.1.133:6789'
 VITE_WS_API_URL = 'ws://192.168.1.133:6789/api/v1/ws'
 VITE_APP_ENVIRONMENT=DEV
-VITE_BASE_API = '/uav'
\ No newline at end of file
+VITE_BASE_API = '/drone-api'
\ No newline at end of file
diff --git a/env/.env.production b/env/.env.production
index 2a94c7e..ea9232a 100644
--- a/env/.env.production
+++ b/env/.env.production
@@ -2,5 +2,5 @@
 VITE_APP_APIGATEWAY_BACKEND_HOST=''
 VITE_API_URL = 'https://dev.jxpskj.com:36789'
 VITE_WS_API_URL = 'wss://dev.jxpskj.com:36789/api/v1/ws'
-VITE_BASE_API = '/uav'
+VITE_BASE_API = '/drone-api'
 
diff --git a/env/.env.stag b/env/.env.stag
index 91218dc..6d789d3 100644
--- a/env/.env.stag
+++ b/env/.env.stag
@@ -1,4 +1,4 @@
 VITE_APP_ENVIRONMENT=STAG
 VITE_API_URL = 'http://192.168.1.133:6789'
 VITE_WS_API_URL = 'ws://192.168.1.133:6789/api/v1/ws'
-VITE_BASE_API = '/uav'
+VITE_BASE_API = '/drone-api'
diff --git a/src/api/http/request.ts b/src/api/http/request.ts
index 773175d..2c57cc5 100644
--- a/src/api/http/request.ts
+++ b/src/api/http/request.ts
@@ -11,7 +11,6 @@
 function getAuthToken () {
   return localStorage.getItem(ELocalStorageKey.Token)
 }
-console.log(import.meta.env.VITE_BASE_API, 'request.ts')
 const instance = axios.create({
   // withCredentials: true,
   headers: {
diff --git a/src/components/GMap.vue b/src/components/GMap.vue
index d65f9bf..e2caaa2 100644
--- a/src/components/GMap.vue
+++ b/src/components/GMap.vue
@@ -447,6 +447,7 @@
               {{ !deviceInfo.device ? EModeText[EModeCode.Disconnected] : EModeText[deviceInfo.device?.mode_code]
               }}</a-col>
             <a-col span="15">
+              <span></span>
               <a-select :showArrow="false" v-model:value="aircraSelected" :bordered="false" :options="aircraftList"
                 :placeholder="aircraftList.length == 0 ? 'N/A' : '请选择'" :disabled="aircraftList.length == 0 ? true : false"
                 size="small" style="width:100%;background-color: #5d5f61;color: #fff;" @change="selectChange"></a-select>
@@ -473,6 +474,21 @@
               </a-button>
             </a-col>
           </a-row>
+          <a-row class="p5" align="middle" justify="space-between">
+            <a-col span="11">
+              <a-button :disabled="deviceInfo.device?.mode_code == 14 || !deviceInfo.device ? true : false"
+                :class="[showAircraft ? 'active-color' : 'unactive-color']" class="width-100" type="primary" size="small"
+                @click="openAircra">
+                监控
+              </a-button>
+            </a-col>
+            <a-col span="11">
+              <a-button :class="[openDroneControl ? 'active-color' : 'unactive-color']" class="width-100" type="primary"
+                size="small" @click="openDeviceSetting">
+                操作
+              </a-button>
+            </a-col>
+          </a-row>
         </div>
       </div>
       <!-- 飞机直播 -->
diff --git a/vite.config.ts b/vite.config.ts
index 94babad..a754a27 100644
--- a/vite.config.ts
+++ b/vite.config.ts
@@ -16,7 +16,7 @@
 // https://vitejs.dev/config/
 export default defineConfig(({ command, mode }) => {
   // 添加第三个参数空字符串时 '' ,会在env中包含所有环境变量;反之,只包含.env文件中配置的环境变量
-  const env = loadEnv(command, process.cwd() + '/env')
+  const env = loadEnv(mode, process.cwd() + '/env')
   // eslint-disable-next-line no-useless-escape
   return {
     plugins: [

--
Gitblit v1.9.3