gemercheung 3 năm trước cách đây
mục cha
commit
3d951dc6b0
3 tập tin đã thay đổi với 121 bổ sung5 xóa
  1. 118 3
      dist/js/index.js
  2. 1 1
      dist/js/index.js.map
  3. 2 1
      src/main.js

+ 118 - 3
dist/js/index.js

@@ -1071,7 +1071,7 @@
     return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
   }
 
-  var Codes = {
+  var Codes$1 = {
     Success: 0,
     Param: 1001,
     Internal: 1002,
@@ -1202,7 +1202,7 @@
           e.value === void 0 && (e.endTime = o), e.value === void 0 && (e.value = o - e.startTime);
         }
 
-        if (e.error ? e.code = ((n = e.error) == null ? void 0 : n.code) || Codes.Internal : e.code = Codes.Success, reporter.report("measurement", e, r), t.length || (t = [e]), e.level === 4 || e.error) {
+        if (e.error ? e.code = ((n = e.error) == null ? void 0 : n.code) || Codes$1.Internal : e.code = Codes$1.Success, reporter.report("measurement", e, r), t.length || (t = [e]), e.level === 4 || e.error) {
           this.error.apply(this, _toConsumableArray(t));
           return;
         }
@@ -2373,11 +2373,126 @@
     return Xverse;
   }();
 
-  new Xverse({
+  var xverse = new Xverse({
     env: "DEV",
     appId: 10016,
     releaseId: '2203120033_29769e'
   });
 
+  var l = /*#__PURE__*/function () {
+    var _ref = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee() {
+      var R;
+      return regenerator.wrap(function _callee$(_context) {
+        while (1) {
+          switch (_context.prev = _context.next) {
+            case 0:
+              _context.prev = 0;
+              _context.next = 3;
+              return (R = xverse.preload) == null ? void 0 : R.start(P, function (M, x) {
+                var I = "(".concat(M, "/").concat(x, ")");
+                s(I);
+              });
+
+            case 3:
+              _context.next = 12;
+              break;
+
+            case 5:
+              _context.prev = 5;
+              _context.t0 = _context["catch"](0);
+
+              if (!(console.error(_context.t0), _context.t0.code === Codes.PreloadCanceled)) {
+                _context.next = 10;
+                break;
+              }
+
+              toast("\u9884\u52A0\u8F7D\u88AB\u53D6\u6D88");
+              return _context.abrupt("return");
+
+            case 10:
+              toast("\u8FDB\u5165\u5931\u8D25, \u8BF7\u91CD\u8BD5");
+              return _context.abrupt("return");
+
+            case 12:
+              _context.prev = 12;
+              _context.next = 15;
+              return xverse.joinRoom({
+                canvas: f,
+                skinId: v,
+                avatarId: g,
+                roomId: d,
+                userId: _,
+                wsServerUrl: C,
+                appId: m,
+                token: " ",
+                nickname: _,
+                firends: ["user1"],
+                viewMode: "full",
+                resolution: T,
+                pathName: y,
+                objectFit: b,
+                hasAvatar: !0,
+                syncToOthers: !0
+              });
+
+            case 15:
+              room = _context.sent;
+              u(), c(), window.room = room, e(!1);
+              _context.next = 23;
+              break;
+
+            case 19:
+              _context.prev = 19;
+              _context.t1 = _context["catch"](12);
+              console.error(_context.t1), alert(_context.t1);
+              return _context.abrupt("return");
+
+            case 23:
+            case "end":
+              return _context.stop();
+          }
+        }
+      }, _callee, null, [[0, 5], [12, 19]]);
+    }));
+
+    return function l() {
+      return _ref.apply(this, arguments);
+    };
+  }();
+
+  var u = function u() {
+    room.on("_coreClick", function (_ref2) {
+      var f = _ref2.point;
+
+      room._userAvatar.moveTo({
+        point: f
+      });
+    });
+  };
+
+  var c = function c() {
+    room.on("repeatLogin", function () {
+      toast("\u8BE5\u7528\u6237\u5DF2\u7ECF\u5728\u5176\u4ED6\u5730\u70B9\u767B\u5F55", {
+        duration: 1e4
+      });
+    }), room.on("reconnecting", function (_ref3) {
+      var f = _ref3.count;
+      toast("\u5C1D\u8BD5\u7B2C".concat(f, "\u6B21\u91CD\u8FDE"));
+    }), room.on("reconnected", function () {
+      toast("\u91CD\u8FDE\u6210\u529F");
+    }), room.on("disconnected", function () {
+      var f = toast("\u8FDE\u63A5\u5931\u8D25\uFF0C\u624B\u52A8\u70B9\u51FB\u91CD\u8BD5", {
+        duration: 1e5,
+
+        onClick() {
+          f.hideToast(), room.reconnect();
+        }
+
+      });
+    });
+  };
+
+  l();
+
 }));
 //# sourceMappingURL=index.js.map

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 1 - 1
dist/js/index.js.map


+ 2 - 1
src/main.js

@@ -86,4 +86,5 @@ const c = ()=>{
             }
         })
     })
-}
+}
+l();