gis-common 1.0.19 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2285,7 +2285,6 @@ var WebSocketClient_WebSocketClient = function (_EventDispatcher) {
2285
2285
  WebSocketClient_createClass(WebSocketClient, [{
2286
2286
  key: 'connect',
2287
2287
  value: function connect() {
2288
- this.checkTimes++;
2289
2288
  this.disconnect();
2290
2289
  if (this.url) {
2291
2290
  try {
@@ -2312,12 +2311,14 @@ var WebSocketClient_WebSocketClient = function (_EventDispatcher) {
2312
2311
  message: message
2313
2312
  });
2314
2313
  };
2315
- this.client.onerror = function (message) {
2316
- self.dispatchEvent({
2317
- type: EventTypeConstant.WEB_SOCKET_ERROR,
2318
- message: message
2319
- });
2320
- };
2314
+ if (this.checkTimes === this.maxCheckTimes) {
2315
+ this.client.onerror = function (message) {
2316
+ self.dispatchEvent({
2317
+ type: EventTypeConstant.WEB_SOCKET_ERROR,
2318
+ message: message
2319
+ });
2320
+ };
2321
+ }
2321
2322
  }
2322
2323
  } catch (ex) {
2323
2324
  console.error('创建ws连接失败' + this.url + ':' + ex);
@@ -2344,6 +2345,7 @@ var WebSocketClient_WebSocketClient = function (_EventDispatcher) {
2344
2345
 
2345
2346
  if (this.checkTimes > times) return;
2346
2347
  setTimeout(function () {
2348
+ _this2.checkTimes++;
2347
2349
  if (_this2.client && _this2.client.readyState !== 0 && _this2.client.readyState !== 1) {
2348
2350
  _this2.connect();
2349
2351
  }
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "gis-common",
3
3
  "description": "gis-common",
4
4
  "main": "dist/resource.min.js",
5
- "version": "1.0.19",
5
+ "version": "1.1.1",
6
6
  "author": "Guo.Yan <luv02@vip.qq.com>",
7
7
  "license": "MIT",
8
8
  "private": false,