Sfoglia il codice sorgente

监控添加判断条件

半生瓜 1 anno fa
parent
commit
506921ccf2
3 ha cambiato i file con 21 aggiunte e 16 eliminazioni
  1. 5 3
      public/config.js
  2. 8 13
      src/components/right.vue
  3. 8 0
      src/request/http.js

+ 5 - 3
public/config.js

@@ -1,14 +1,16 @@
1 1
 /*
2 2
  * @Author: zy1125 1515706227@qq.com
3 3
  * @Date: 2023-11-08 20:40:07
4
- * @LastEditors: zy1125 1515706227@qq.com
5
- * @LastEditTime: 2023-12-20 17:22:21
4
+ * @LastEditors: 半生瓜 1515706227@qq.com
5
+ * @LastEditTime: 2024-01-15 11:11:02
6 6
  * @FilePath: \v3_yyz\public\config.js
7 7
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
8 8
  */
9 9
 window.g = {
10 10
     // 获取数据请求地址
11
-    BASE_API: "https://test.lqkj.top//cmioc3-server",
11
+    BASE_API: "https://weizhi.huanghuai.edu.cn/yyzioc-server/",
12
+    
13
+
12 14
     // BASE_API: "http://192.168.4.219:12397/ioc-server",
13 15
     // UE_IP: "http://192.168.4.159"
14 16
     UE_IP: "http://127.0.0.1:80"

+ 8 - 13
src/components/right.vue

@@ -252,7 +252,6 @@ export default ({
252 252
             // })
253 253
 
254 254
             let res = await getDevice()
255
-            console.log('s12312123', res);
256 255
             if (res.code !== 200) {
257 256
                 ElMessage.error("数据请求出错");
258 257
             }
@@ -268,32 +267,28 @@ export default ({
268 267
 
269 268
             monitor.map((res) => {
270 269
                 console.log('sadhi2', res.activeMonitor);
271
-
272
-                res.activeMonitor.array.map(array => {
273
-
270
+                if(res.activeMonitor.array){
271
+                    res.activeMonitor.array.map(array => {
274 272
                     //视频转码
275 273
                     getvideo({
276 274
                         "rtsp": array.src,
277 275
                     }).then((res) => {
278
-                        console.log('sadnuq21', res.data);
279
-                        console.log('sadnuq2121', res.data.httpFlv);
280 276
                         // array.src = 'http://kbs-dokdo.gscdn.com/dokdo_300/_definst_/dokdo_300.stream/playlist.m3u8'
281
-                           array.src=res.data.httpFlv
277
+                        array.src=res.data.httpFlv
282 278
                     })
283
-
284
-
285
-                })
286
-                res.activeMonitor.array1.map(array1 => {
287
-                    console.log('asdui1231', array1);
279
+                    })
280
+                }
281
+                if ( res.activeMonitor.array1) {
282
+                    res.activeMonitor.array1.map(array1 => {
288 283
                     //视频转码
289 284
                     getvideo({
290 285
                         "rtsp": array1.src,
291 286
                     }).then((res) => {
292
-                        console.log('sadnuq212123s2', res.data);
293 287
                         // array1.src = 'http://kbs-dokdo.gscdn.com/dokdo_300/_definst_/dokdo_300.stream/playlist.m3u8'
294 288
                            array1.src=res.data.httpFlv
295 289
                     })
296 290
                 })
291
+                }
297 292
 
298 293
 
299 294
             })

+ 8 - 0
src/request/http.js

@@ -1,3 +1,11 @@
1
+/*
2
+ * @Author: 半生瓜 1515706227@qq.com
3
+ * @Date: 2023-10-18 10:46:30
4
+ * @LastEditors: 半生瓜 1515706227@qq.com
5
+ * @LastEditTime: 2024-01-09 09:12:35
6
+ * @FilePath: \v3_yyz\src\request\http.js
7
+ * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
8
+ */
1 9
 import axios from 'axios'
2 10
 import { ElMessage } from 'element-plus';
3 11