MSI\liwei 3 年之前
父节点
当前提交
34fd8b0975
共有 3 个文件被更改,包括 13 次插入6 次删除
  1. 3 1
      login.js
  2. 9 4
      main.js
  3. 1 1
      meeting.js

+ 3 - 1
login.js

@@ -65,7 +65,9 @@ Package.prototype = {
             _t.keepalive();
           }, 20000);
         },
-        error: function (data) {},
+        error: function (data) {
+          _t.login()
+        },
       });
     }
   },

+ 9 - 4
main.js

@@ -1,7 +1,7 @@
 // login
 
 var setting = {
-  username: "huashe3",
+  username: "huashe1",
   password: "huashe123",
   ip: "10.55.134.3",
   host: "http",
@@ -25,7 +25,11 @@ window.onload = () => {
             username: setting.username,
             password: setting.password,
           });
-          await package.login();
+          if (localStorage.getItem('token')) {
+            await package.keepalive();
+          } else {
+            await package.login();
+          }
         }
         // 打开单兵视频
         if (e.data.key === "danbing") {
@@ -129,7 +133,7 @@ window.onload = () => {
                 userName: res.userName,
                 userId: res.userCode,
                 region: res.paasId,
-                type: "single",
+                type: "client",
                 // speak:'true',
                 number: res.userPhone,
                 deviceId: res.deviceId,
@@ -137,8 +141,9 @@ window.onload = () => {
               });
               // await meeting.playVideo(meeting.InvitedMembers);
               meeting.playVideo({
-                type: "single",
+                type: "client",
                 number: res.userPhone,
+                userId: res.userCode,
                 deviceId: res.deviceId,
                 channelId: res.chnId,
               })

+ 1 - 1
meeting.js

@@ -436,7 +436,7 @@ Meeting.prototype = {
     return this.getUserCode(callback);
   },
   closeClient() {
-    this.theSocket.closeClient && this.theSocket.closeClient();
+    this.theSocket && this.theSocket.closeClient && this.theSocket.closeClient();
   },
   closeVideo() {
     this.theSocket.closeAllVideo && this.theSocket.closeAllVideo();