xieb
2023-09-27 922cb51747f298858179f9e0d27b5ad9ad5c5cac
Merge remote-tracking branch 'origin/demo' into demo
13 files modified
1 files added
77 ■■■■ changed files
env/.env 6 ●●●●● patch | view | raw | blame | history
env/.env.dev 3 ●●●●● patch | view | raw | blame | history
env/.env.production 6 ●●●● patch | view | raw | blame | history
env/.env.stag 15 ●●●● patch | view | raw | blame | history
package.json 5 ●●●● patch | view | raw | blame | history
src/api/http/config.ts 9 ●●●●● patch | view | raw | blame | history
src/api/http/request.ts 4 ●●●● patch | view | raw | blame | history
src/components/GMap.vue 3 ●●●● patch | view | raw | blame | history
src/components/MediaPanel.vue 2 ●●● patch | view | raw | blame | history
src/env.d.ts 8 ●●●● patch | view | raw | blame | history
src/main.ts 2 ●●● patch | view | raw | blame | history
src/websocket/util/config.ts 3 ●●●● patch | view | raw | blame | history
tsconfig.json 9 ●●●●● patch | view | raw | blame | history
vite.config.ts 2 ●●● patch | view | raw | blame | history
env/.env
@@ -1,4 +1,2 @@
VITE_APP_ENVIRONMENT=DEV
VITE_APP_APIGATEWAY_BACKEND_HOST=''
VITE_HTTP = 'http://172.16.13.129:8100'
VITE_CESIUM_TOKEN = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJhMjdmNGUxZC02YzY3LTQyZWUtOTNmYy1hNTI0MDRkZDY2ZmEiLCJpZCI6MTYxODgyLCJpYXQiOjE2OTI3NTQyNDV9.Pm7xTwPmKowPzFgJ0TsIKOtthigq86BLJX4c8M97Hhw'
VITE_API_URL = 'http://192.168.1.198:6789'
VITE_WS_API_URL = 'ws://192.168.1.198:6789/api/v1/ws'
env/.env.dev
New file
@@ -0,0 +1,3 @@
VITE_API_URL = 'http://192.168.1.198:6789'
VITE_WS_API_URL = 'ws://192.168.1.198:6789/api/v1/ws'
VITE_APP_ENVIRONMENT=DEV
env/.env.production
@@ -1,4 +1,4 @@
VITE_APP_ENVIRONMENT=production
VITE_APP_ENVIRONMENT=PROD
VITE_APP_APIGATEWAY_BACKEND_HOST=''
VITE_HTTP = 'http://172.16.13.129:8100'
VITE_CESIUM_TOKEN = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJhMjdmNGUxZC02YzY3LTQyZWUtOTNmYy1hNTI0MDRkZDY2ZmEiLCJpZCI6MTYxODgyLCJpYXQiOjE2OTI3NTQyNDV9.Pm7xTwPmKowPzFgJ0TsIKOtthigq86BLJX4c8M97Hhw'
VITE_API_URL = 'https://dev.jxpskj.com:36789'
VITE_WS_API_URL = 'wss://dev.jxpskj.com:36789/api/v1/ws'
env/.env.stag
@@ -1,14 +1,3 @@
###
 # @Author: husq 931347610@qq.com
 # @Date: 2023-08-22 09:55:39
 # @LastEditors: husq 931347610@qq.com
 # @LastEditTime: 2023-08-30 17:56:53
 # @FilePath: \Cloud-API-Demo-Web\env\.env.stag
 # @Description:
 #
 # Copyright (c) 2023 by ${git_name_email}, All Rights Reserved.
###
VITE_APP_ENVIRONMENT=STAG
VITE_APP_APIGATEWAY_BACKEND_HOST=''
VITE_HTTP = 'http://172.16.13.129:8100'
VITE_CESIUM_TOKEN = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJhMjdmNGUxZC02YzY3LTQyZWUtOTNmYy1hNTI0MDRkZDY2ZmEiLCJpZCI6MTYxODgyLCJpYXQiOjE2OTI3NTQyNDV9.Pm7xTwPmKowPzFgJ0TsIKOtthigq86BLJX4c8M97Hhw'
VITE_API_URL = 'http://192.168.1.198:6789'
VITE_WS_API_URL = 'ws://192.168.1.198:6789/api/v1/ws'
package.json
@@ -3,8 +3,11 @@
  "version": "0.0.1",
  "scripts": {
    "serve": "vite",
    "serve:dev": "vite --mode dev",
    "serve:production": "vite --mode production",
    "build:test": "vite build --mode stag",
    "build": "vite build",
    "build:production": "vite build --mode production",
    "build:dev": "vite build --mode dev",
    "preview": "vite preview",
    "lint": "eslint --fix"
  },
src/api/http/config.ts
@@ -4,17 +4,16 @@
  appId: '136971', // You need to go to the development website to apply.
  appKey: '3e56cb20958060caeb1071cdb32400e', // You need to go to the development website to apply.
  appLicense: 'eS2rczbPpEUZZkOuek7hB1fugv3TE0RdKyEU319A2cxmVKs7Bc11RadcPcHnQJjBq/Peja5R6bp2IILCypa2lskCUGXkXHmqxdPIVTyMQpkZtjM+eXLut/VHPdXVZOvYxKFMVel6jfEyd4rWL9jBI1N34rCvwSgad6T49mRC8R0=', // You need to go to the development website to apply
  // http
  // http://172.16.13.64:8100
  // baseURL: 'http://192.168.1.133:6789', // This url must end with "/". Example: 'http://192.168.1.1:6789/'
  // baseURL: 'http://192.168.1.198:6789', // This url must end with "/". Example: 'http://192.168.1.1:6789/'
  baseURL: 'https://dev.jxpskj.com:36789', // This url must end with "/". Example: 'http://192.168.1.1:6789/'
  // baseURL: 'http://192.168.1.133:6789', // This url must end with "/". Example: 'http://192.168.1.1:6789/'
  baseURL: 'http://192.168.1.198:6789', // This url must end with "/". Example: 'http://192.168.1.1:6789/'
  // ws: 'ws//127.0.0.1:6789/api/v1/ws',
  // ws://192.168.1.198:1883/
  // websocketURL: 'ws://192.168.1.198:6789/api/v1/ws', // Example: 'ws://192.168.1.198:6789/api/v1/ws'
  websocketURL: 'ws://192.168.1.198:6789/api/v1/ws', // Example: 'ws://192.168.1.198:6789/api/v1/ws'
  // websocketURL: 'ws://192.168.1.133:6789/api/v1/ws', // Example: 'ws://192.168.1.198:6789/api/v1/ws'
  websocketURL: 'wss://dev.jxpskj.com:36789/api/v1/ws', // Example: 'ws://192.168.1.198:6789/api/v1/ws'
  // websocketURL: 'wss://dev.jxpskj.com:36789/api/v1/ws', // Example: 'ws://192.168.1.198:6789/api/v1/ws'
  // livestreaming
  // RTMP  Note: This IP is the address of the streaming server. If you want to see livestream on web page, you need to convert the RTMP stream to WebRTC stream.
src/api/http/request.ts
@@ -10,7 +10,7 @@
function getAuthToken () {
  return localStorage.getItem(ELocalStorageKey.Token)
}
console.log(import.meta.env.VITE_API_URL, 'request.ts')
const instance = axios.create({
  // withCredentials: true,
  headers: {
@@ -22,7 +22,7 @@
instance.interceptors.request.use(
  config => {
    config.headers[ELocalStorageKey.Token] = localStorage.getItem(ELocalStorageKey.Token)
    config.baseURL = CURRENT_CONFIG.baseURL
    config.baseURL = import.meta.env.VITE_API_URL
    // config.headers[REQUEST_ID] = uuidv4()
    // config.baseURL = CURRENT_CONFIG.baseURL
    return config
src/components/GMap.vue
@@ -169,7 +169,8 @@
      </div>
    </div>
    <!-- 机场OSD -->
    <div class="osd-panel fz12" v-if="osdVisible.visible && osdVisible.is_dock">
    <!--  && osdVisible.is_dock -->
    <div class="osd-panel fz12" v-if="osdVisible.visible">
      <div class="fz16 pl5 pr5 flex-align-center flex-row flex-justify-between"
        style="border-bottom: 1px solid #515151; height: 10%;">
        <span>{{ osdVisible.gateway_callsign }}</span>
src/components/MediaPanel.vue
@@ -122,7 +122,7 @@
const showVideo = ref(false)
const videoPlayerId = ref('videoPlayerId')
// 文件前缀
const prefix = 'http://dev.jxpskj.com:9000/cloud-bucket'
const prefix = 'https://dev.jxpskj.com:9000/cloud-bucket'
// 搜索栏配置项
const searchPanelOptions = reactive({
  size: 'large',
src/env.d.ts
@@ -1,9 +1,15 @@
// Environment variable definition
// https://cn.vitejs.dev/guide/env-and-mode.html#env-files
/// <reference types="vite/client" />
interface ImportMetaEnv {
  VITE_APP_ENVIRONMENT: 'DEV' | 'STAG' | 'UAT' | 'PROD',
  // api gateway
  VITE_APP_APIGATEWAY_BACKEND_HOST: string
  VITE_API_URL: string
  VITE_WS_API_URL: string
  // More environment variables...
}
interface ImportMeta {
  readonly env: ImportMetaEnv
}
src/main.ts
@@ -2,7 +2,7 @@
 * @Author: husq 931347610@qq.com
 * @Date: 2023-09-13 18:21:07
 * @LastEditors: husq 931347610@qq.com
 * @LastEditTime: 2023-09-25 15:54:31
 * @LastEditTime: 2023-09-26 17:11:02
 * @FilePath: \Cloud-API-Demo-Web\src\main.ts
 * @Description:
 *
src/websocket/util/config.ts
@@ -2,11 +2,10 @@
import { CURRENT_CONFIG } from '/@/api/http/config'
const user = localStorage.getItem('user_info')
export function getWebsocketUrl () {
  const token: string = localStorage.getItem(ELocalStorageKey.Token) || '' as string
  // const url = CURRENT_CONFIG.websocketURL
  const url = CURRENT_CONFIG.websocketURL + '?x-auth-token=' + encodeURI(token)
  const url = import.meta.env.VITE_WS_API_URL + '?x-auth-token=' + encodeURI(token)
  return url
}
tsconfig.json
@@ -12,7 +12,7 @@
    "types": ["vite/client"],
    "lib": [
      "esnext",
      "dom"
      "dom",
    ],
    "paths": {
      "/@/*": [
@@ -24,8 +24,9 @@
    "src/**/*.ts",
    "src/**/*.d.ts",
    "src/**/*.tsx",
    "src/**/*.vue"
, "src/vendors/coordtransform.js",
"types/auto-imports.d.ts"
    "src/**/*.vue",
    "src/vendors/coordtransform.js",
    "types/auto-imports.d.ts",
    "src/env.d.ts"
]
}
vite.config.ts
@@ -86,7 +86,7 @@
      },
    }
  },
  base: '/',
  base: './',
  build: {
    target: ['es2015'], // 最低支持 es2015
    sourcemap: true