Your Name 3 жил өмнө
parent
commit
a7d4145fab

+ 4 - 3
public/login.js

@@ -61,9 +61,9 @@ Package.prototype = {
                     );
                 },
                 success: function(jsonResult) {
-                    setTimeout(function() {
-                        _t.keepalive();
-                    }, 20000);
+                    // setTimeout(function() {
+                    //     _t.keepalive();
+                    // }, 20000);
                 },
                 error: function(data) {
                     _t.login()
@@ -97,6 +97,7 @@ Package.prototype = {
                     encryptType: "MD5",
                     clientType: "winpc",
                     pid: 2548,
+                    expiredTime:86400,
                 }),
                 beforeSend: function(xhr) {
                     xhr.setRequestHeader("X-Subject-Token", "");

+ 10 - 9
src/api/dahua.ts

@@ -77,15 +77,16 @@ export const DAHUALogin = (params: DAHUALoginParams) =>
     },
   });
 
-export const DAHUAKeepAlive = (params: DAHUAKeepParams) =>
-  request<KeepAliveResponse>('PUT', {
-    url: `${DA_HUA_URL_PREFIX}/videoService/accounts/token/keepalive`,
-    data: params,
-    headers: {
-      'Content-Type': 'application/json',
-      'X-Subject-Token': params.token,
-    },
-  });
+export const DAHUAKeepAlive = (params: DAHUAKeepParams) =>{};
+  // request<KeepAliveResponse>('PUT', {
+  //   url: `${DA_HUA_URL_PREFIX}/videoService/accounts/token/keepalive`,
+  //   data: params,
+  //   headers: {
+  //     'Content-Type': 'application/json',
+  //     'X-Subject-Token': params.token,
+  //   },
+  // });
+
 
 export const DAHUAUserInfo = (params: DAHUAKeepParams) =>
   request<BaseResponse>('GET', {

+ 80 - 24
src/components/MarkerMap/index.tsx

@@ -280,30 +280,89 @@ export default defineComponent({
                         //  console.log(memberObj);
                         //  meetObj.mebmber.push(memberObj);
 
-                        mainstore.videoisshow = true;
-                        mainstore.videotitle = marker['name'] + "";
+                        // mainstore.videoisshow = true;
                        
-                        // try {
-                          const meeting = new Meeting();
+                        mainstore.videoisshow = true;
+                        // // try {
+                          // daHuaStore.DAHUAUserObj(marker["userId"]).then(deviceUser=>{
+                            mainstore.videotitle = marker["userName"] + "";
+                          // });
+
                           const channelid = marker['channelId']+"";
-                          // console.log(channelid)
-                          // const channelid = "lJmfmlS0A1DJAUR812D9MV";
-                          // console.log(channelid)
-          
-                          meeting.closeVideo();
-                          meeting.closeClient();
-                         
-                          // meeting.deleteMeeting();
-          
-                          meeting.openClient(() => {
-                            meeting.playVideo({
-                              type: 'single',
-                              deviceId: marker['deviceCode'],
-                              channelId: channelid,
-                            });
-                          });
+                          
+
+                          if(window.metting){
+                            const meeting = window.metting;
+                            meeting.settargetId("vPlayArea");
+                              meeting.playVideo({
+                                type: 'single',
+                                deviceId: marker['deviceCode'],
+                                channelId: channelid,
+                              });
+                              setTimeout(() => {
+                                try{
+                                  if(window.vPlayArea){
+                                    window.vPlayArea.resize();
+                                    window.vPlayArea.dragResize(0,0,0,0)
+                                }
+                                }catch(E){
+                                }
+                                
+                              }, 500);
+                              
+              
+                           }else{
+                            const meeting = new Meeting();
+                            if(window.theSocket){
+                              meeting.settargetId("vPlayArea");
+                              meeting.playVideo({
+                                type: 'single',
+                                deviceId: marker['deviceCode'],
+                                channelId: channelid,
+                              });
+                              window.metting = meeting;
+                              setTimeout(() => {
+                                try{
+                                  if(window.vPlayArea){
+                                    window.vPlayArea.resize();
+                                    window.vPlayArea.dragResize(0,0,0,0)
+                                }
+                                }catch(E){
+                                }
+                                
+                              }, 500);
+              
+                            }else{
+                              meeting.openClient(() => {
+                              
+                                meeting.settargetId("vPlayArea");
+                                meeting.playVideo({
+                                  type: 'single',
+                                  deviceId: marker['deviceCode'],
+                                  channelId: channelid,
+                                });
+                                window.metting = meeting;
+              
+                                setTimeout(() => {
+                                  try{
+                                    if(window.vPlayArea){
+                                      window.vPlayArea.resize();
+                                      window.vPlayArea.dragResize(0,0,0,0)
+                                  }
+                                  }catch(E){
+                                  }
+                                  
+                                }, 1000);
+                                
+                             
+                              });
+              
+                            }
+              
+                            }
           
-                          mainstore.videohandle = meeting;
+                        //   mainstore.videohandle = meeting;
+            // });
 
             // const DAHUA = document.getElementById('DAHUA') as HTMLIFrameElement;
             // DAHUA?.contentWindow?.postMessage(
@@ -415,9 +474,6 @@ export default defineComponent({
               }
 
               }
-              
-
-             
 
              }
              if(type==2){

+ 5 - 5
src/store/useDaHuaStore.ts

@@ -110,11 +110,11 @@ export default defineStore<'daHua', DaHuaStateType, {}, DaHuaActionsType>(
       },
       async KEEPAlive() {
         const that = this;
-        this.timer = setInterval(() => {
-          DAHUAKeepAlive({
-            token: that.dhToken,
-          });
-        }, 20000);
+        // this.timer = setInterval(() => {
+        //   DAHUAKeepAlive({
+        //     token: that.dhToken,
+        //   });
+        // }, 20000);
       },
       async DAHUAUserInfo() {
         const dahuaToken = localStorage.getItem('DAHUA_token') ?? '';