@haluo/util 1.0.25 → 1.0.26

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.
@@ -19,7 +19,11 @@ var SendTracker = /** @class */ (function () {
19
19
  }
20
20
  SendTracker.prototype.send = function (data) {
21
21
  if (data === void 0) { data = {}; }
22
- if (window.location.host.indexOf('localhost') > -1)
22
+ var host = window.location.host;
23
+ if (host.indexOf('localhost') > -1)
24
+ return;
25
+ var reg = /((2(5[0-5]|[0-4]\d))|[0-1]?\d{1,2})(\.((2(5[0-5]|[0-4]\d))|[0-1]?\d{1,2})){3}/g;
26
+ if (reg.test(host))
23
27
  return;
24
28
  var log = __assign(__assign({}, getExtraData()), data);
25
29
  var formBody = [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@haluo/util",
3
- "version": "1.0.25",
3
+ "version": "1.0.26",
4
4
  "main": "./dist/index.js",
5
5
  "author": "<wanghui@jddmoto.com>",
6
6
  "description": "哈罗摩托工具库",
@@ -6,7 +6,10 @@ class SendTracker {
6
6
  this.url = ''
7
7
  }
8
8
  send(data:any = {}) {
9
- if(window.location.host.indexOf('localhost') > -1) return
9
+ const host = window.location.host
10
+ if(host.indexOf('localhost') > -1) return
11
+ const reg = /((2(5[0-5]|[0-4]\d))|[0-1]?\d{1,2})(\.((2(5[0-5]|[0-4]\d))|[0-1]?\d{1,2})){3}/g
12
+ if(reg.test(host)) return
10
13
  const log = { ...getExtraData(), ...data}
11
14
  let formBody: any = [];
12
15
  for (var property in log) {