Jelajahi Sumber

视频token

wangtao 2 tahun lalu
induk
melakukan
53fa45cb4e

+ 2 - 1
public/static/config.js

@@ -22,4 +22,5 @@ PLATFROM_WEBSOCKET.wsUrl = `ws://10.21.39.1:8080/afws/uskyWS?${userInfo}`
 //iframe 请求路径
 //http://www.thingjs.com/s/ef7ee6a73896c01bda77e679?params=105b0f77fd24654d4eebc434e9 初始路径http://172.16.120.246:9000/
 var PLATFROM_IFRAME = {};
-PLATFROM_IFRAME.iframeUrl = `https://www.thingjs.com/s/ef7ee6a73896c01bda77e679?params=105b0f77fd24654d4eebc434e9`
+// PLATFROM_IFRAME.iframeUrl = `https://www.thingjs.com/s/ef7ee6a73896c01bda77e679?params=105b0f77fd24654d4eebc434e9`
+PLATFROM_IFRAME.iframeUrl = `http://10.21.39.6:9000/`

+ 1 - 0
src/views/device/camera/index.vue

@@ -335,6 +335,7 @@ export default {
         pageNo:1,
         pageSize:15,
         unitType:1,
+        token:"d6790e9ac3c419f6fc8d48f8c2957afd"
       },
       dateDataJlStatus:false,//回放记录时间button状态
       //表格自适应高度

+ 10 - 7
src/views/device/camera2/index.vue

@@ -351,7 +351,8 @@ export default {
         unit:undefined,
         current:1,
         size:15,
-        id:undefined
+        id:undefined,
+        token:"d6790e9ac3c419f6fc8d48f8c2957afd"
       },
       dateDataJlStatus:false,//回放记录时间button状态
       //表格自适应高度
@@ -593,13 +594,14 @@ export default {
     //画面列表
     playListOperation(row){
       this.playListTitle = `"${row.name}"摄像头    画面列表`
-      getLocalChannel({"pageSize":1000,"size":"1","deviceId":row.code,"unitType":1}).then(Response =>{
+      getLocalChannel({"pageSize":1000,"size":"1","deviceId":row.code,"unitType":1,token:"d6790e9ac3c419f6fc8d48f8c2957afd"}).then(Response =>{
         if(Response.data.pageList.length>0){
           this.dhUrl = Response.data.pageList.map((val, index) =>{
             return {
               id: index + 1,
               name: val.name,
-              url: "http://" + val.nvr_ip + ":" + val.hls_port + "/live/cameraid/" + val.deviceId + "%24" + val.id.split("$")[(val.id.split("$")).length-1] + "/substream/1.m3u8"
+              url: "http://" + val.nvr_ip + ":" + val.hls_port + "/live/cameraid/" + val.deviceId + "%24" + val.id.split("$")[(val.id.split("$")).length-1] + "/substream/1.m3u8",
+              data:val
             };
           })
           this.NoHplay = true
@@ -622,6 +624,7 @@ export default {
                     id: index + 1,
                     name: val.name,
                     url:val.url,
+                    data:val
                   }
                 })
                 this.NoHplay = false
@@ -651,8 +654,8 @@ export default {
     playH(start,end){
       this.destroyHls()
       let row = this.hrow
-      //let url = "http://" + row.nvr_ip + ":" + row.hls_port + "/vod/device/cameraid/" + row.deviceId + "%24" + row.id.split("$")[(row.id.split("$")).length-1] + "/substream/1/recordtype/1/totallength/" + Number(end-start) + "/begintime/" + start + "/endtime/" + end + ".m3u8"
-      this.loadVideoFn(row.url)
+      let url = "http://" + row.data.nvr_ip + ":" + row.data.hls_port + "/vod/device/cameraid/" + row.data.deviceId + "%24" + row.data.id.split("$")[(row.data.id.split("$")).length-1] + "/substream/1/recordtype/1/totallength/" + Number(end-start) + "/begintime/" + start + "/endtime/" + end + ".m3u8"
+      this.loadVideoFn(url)
     },
 
     destroyHls: function () {
@@ -705,7 +708,7 @@ export default {
       if(row){
         this.AddOrEditForm = row
         if(row.code != "1"){
-          getLocalChannel({"pageSize":1000,"size":"1","deviceId":row.code,"unitType":1}).then(Response =>{
+          getLocalChannel({"pageSize":1000,"size":"1","deviceId":row.code,"unitType":1,token:"d6790e9ac3c419f6fc8d48f8c2957afd"}).then(Response =>{
             if(Response.data.pageList){
               this.dhUrl = Response.data.pageList.map((val, index) =>{
                 return {
@@ -806,7 +809,7 @@ export default {
     deviceUrl(val){
       if(val != "1"){
         this.AddOrEditForm.GLcode = val
-        getLocalChannel({"pageSize":1000,"size":"1","deviceId":val,"unitType":1}).then(Response =>{
+        getLocalChannel({"pageSize":1000,"size":"1","deviceId":val,"unitType":1,token:"d6790e9ac3c419f6fc8d48f8c2957afd"}).then(Response =>{
           if(Response.data.pageList){
             this.dhUrl = Response.data.pageList.map((val, index) =>{
                return {

+ 10 - 5
src/views/index/components/monitor.vue

@@ -222,11 +222,16 @@ export default {
       function (event) {
         var isDOM = typeof event.data === "object";
         // // 监听父窗口发送过来的数据向服务器发送post请求
-        var data = event.data;
-        if(data?.param?.name){
-          getLocalChannel({pageNo:1,pageSize:1,name:data.param.name}).then(Response =>{
+        var msg = event.data;
+        if(msg?.param?.name){
+          getLocalChannel({pageNo:1,pageSize:1000,name:msg.param.name,token:"d6790e9ac3c419f6fc8d48f8c2957afd"}).then(Response =>{
             if(Response.data.pageList.length>0){
-              let data = Response.data.pageList[0]
+              let data = {}
+              for(let i =0;i<Response.data.pageList.length;i++){
+                if(msg.param.name == Response.data.pageList[i].name){
+                  data = Response.data.pageList[i]
+                }
+              }
               _this.videoMsg = data
               _this.videoS = true
               let url = "http://" + data.nvr_ip + ":" + data.hls_port + "/live/cameraid/" + data.deviceId + "%24" + data.id.split("$")[(data.id.split("$")).length-1]  + "/substream/1.m3u8"
@@ -254,7 +259,7 @@ export default {
 
     //获取视频配置数据
     getList(){
-       getLocalChannel({unitType:1,pageNo:1,pageSize:500,}).then(Response =>{
+       getLocalChannel({unitType:1,pageNo:1,pageSize:500,token:"d6790e9ac3c419f6fc8d48f8c2957afd"}).then(Response =>{
         if(Response.data.pageList.length>0){
           let data = Response.data.pageList
           let arr = []