husq
2023-10-11 277ef1f7f45ffe9c91194315dbcc2508ae008668
环境变量配置修改
7 files modified
27 ■■■■ changed files
env/.env 2 ●●● patch | view | raw | blame | history
env/.env.dev 2 ●●● patch | view | raw | blame | history
env/.env.production 2 ●●● patch | view | raw | blame | history
env/.env.stag 2 ●●● patch | view | raw | blame | history
src/api/http/request.ts 1 ●●●● patch | view | raw | blame | history
src/components/GMap.vue 16 ●●●●● patch | view | raw | blame | history
vite.config.ts 2 ●●● patch | view | raw | blame | history
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'
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'
VITE_BASE_API = '/drone-api'
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'
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'
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: {
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>
      <!-- 飞机直播 -->
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: [