Selaa lähdekoodia

测试环境配置完成

wangtao 1 vuosi sitten
vanhempi
commit
792300f08f
5 muutettua tiedostoa jossa 35 lisäystä ja 10 poistoa
  1. 7 1
      .env.development
  2. 7 1
      .env.production
  3. 7 1
      .env.staging
  4. 13 7
      src/views/index.vue
  5. 1 0
      vue.config.js

+ 7 - 1
.env.development

@@ -5,7 +5,13 @@ VUE_APP_TITLE = 东信设备设施管理系统
 ENV = 'development'
 
 # 东信设备设施管理系统/开发环境
-VUE_APP_BASE_API = '/dmapi'
+VUE_APP_BASE_API = 'https://smartpark.caih.com/dmapi/'
+# 实时告警信息获取
+VUE_APP_WEBSOCKET_API = '10.21.39.1:8084'
+# thingJs地址
+VUE_APP_THINGJS_API = 'https://www.thingjs.com/s/ef7ee6a73896c01bda77e679?params=105b0f77fd24654d4eebc434e9'
+# 消防物联网视频拉流
+VUE_APP_VIDEO_API = 'https://iot.usky.cn'
 
 # 路由懒加载
 VUE_CLI_BABEL_TRANSPILE_MODULES = true

+ 7 - 1
.env.production

@@ -5,4 +5,10 @@ VUE_APP_TITLE = 东信设备设施管理系统
 ENV = 'production'
 
 # 管理系统/生产环境
-VUE_APP_BASE_API = '/dmapi'
+VUE_APP_BASE_API = 'https://smartpark.caih.com/dmapi/'
+# 实时告警信息获取
+VUE_APP_WEBSOCKET_API = '10.21.39.1:8084'
+# thingJs地址
+VUE_APP_THINGJS_API = 'https://www.thingjs.com/s/ef7ee6a73896c01bda77e679?params=105b0f77fd24654d4eebc434e9'
+# 消防物联网视频拉流
+VUE_APP_VIDEO_API = 'https://iot.usky.cn'

+ 7 - 1
.env.staging

@@ -7,4 +7,10 @@ NODE_ENV = production
 ENV = 'staging'
 
 # 管理系统/测试环境
-VUE_APP_BASE_API = '/stage-api'
+VUE_APP_BASE_API = 'http://10.95.2.31:3084/dmapi/'
+# 实时告警信息获取
+VUE_APP_WEBSOCKET_API = '10.95.2.31:3084'
+# thingJs地址
+VUE_APP_THINGJS_API = 'https://www.thingjs.com/s/ef7ee6a73896c01bda77e679?params=105b0f77fd24654d4eebc434e9'
+# 消防物联网视频拉流
+VUE_APP_VIDEO_API = 'https://iot.usky.cn'

+ 13 - 7
src/views/index.vue

@@ -49,7 +49,6 @@
                             style="padding: 0 !important"
                         >
                             <div class="map" style="height: calc(48vh - 35px)">
-                                <!-- <iframe id="myIframe" style="width:100%;height:100%;border:none;" src='https://www.thingjs.com/s/ef7ee6a73896c01bda77e679?params=105b0f77fd24654d4eebc434e9'></iframe> -->
                                 <iframe
                                     id="myIframe"
                                     style="
@@ -57,7 +56,9 @@
                                         height: 100%;
                                         border: none;
                                     "
-                                    src="https://www.thingjs.com/s/b11227d4fd5505106989737c?params=105b0f77fd24654d4eebc434e9"
+                                    :src="thingJsApi"
+
+
                                 ></iframe>
                             </div>
                         </el-card>
@@ -490,6 +491,8 @@ export default {
     },
     data() {
         return {
+            thingJsApi:process.env.VUE_APP_THINGJS_API,
+            websocketApi:process.env.VUE_APP_WEBSOCKET_API,
             hls: null,
             timeNum: null,
             title: "楼层展示",
@@ -580,7 +583,7 @@ export default {
         this.getList();
         this.getCollect();
         this.yhTable();
-        this.initWebSocket();
+        // this.initWebSocket();
         this.getBuild();
     },
     mounted() {},
@@ -783,7 +786,7 @@ export default {
             }).then((res) => {
                 if (IDX == 7) {
                     this.loadVideoFn(
-                        `https://iot.usky.cn/hls/${code}.m3u8`,
+                        `${process.env.VUE_APP_VIDEO_API}/hls/${code}.m3u8`,
                         code
                     );
                 } else {
@@ -808,7 +811,7 @@ export default {
                     if (data[i].DEVICE == code) {
                         if (data[i].ONAIR && !data[i].LIVEONLINE) {
                             this.loadVideoFn(
-                                `https://iot.usky.cn/hls//${code}.m3u8`,
+                                `${process.env.VUE_APP_VIDEO_API}/hls//${code}.m3u8`,
                                 code
                             );
 
@@ -932,6 +935,7 @@ export default {
             });
         },
         initWebSocket() {
+
             getTbAlarm({
                 current: 1,
                 size: 500,
@@ -944,7 +948,9 @@ export default {
             let that = this;
             let num = 0;
             if ("WebSocket" in window) {
-                this.ws = new WebSocket("wss://10.21.39.1:8084/dm/alarmPush");
+                // this.ws = new WebSocket("wss://10.21.39.1:8084/dm/alarmPush");
+                this.ws = new WebSocket("wss://"+this.websocketApi+"/dm/alarmPush");
+
                 // console.log(this.ws)
                 this.ws.onopen = () => {
                     // console.log("websocket连接成功");
@@ -973,7 +979,7 @@ export default {
                     //console.log("连接已关闭...");
                     //断线重新连接
                     setTimeout(() => {
-                        this.initWebSocket();
+                        // this.initWebSocket();
                     }, 2000);
                 };
             } else {

+ 1 - 0
vue.config.js

@@ -25,6 +25,7 @@ module.exports = {
     lintOnSave: process.env.NODE_ENV === 'development',
     // 如果你不需要生产环境的 source map,可以将其设置为 false 以加速生产环境构建。
     productionSourceMap: false,
+
     // webpack-dev-server 相关配置
     devServer: {
         host: '0.0.0.0',