@yysports/tools 1.0.6 → 1.0.7

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.
@@ -407,10 +407,13 @@ var Track = /*#__PURE__*/function () {
407
407
  }, {
408
408
  key: "apiLog",
409
409
  value: function apiLog(_apiLog) {
410
- this.pushQueue({
410
+ // API 日志无需等待队列,直接发送
411
+ var config = this.config;
412
+ navigator.sendBeacon("".concat(this.config.domain, "/pousheng-guard/api/analysis/track"), pako.deflate(JSON.stringify([_objectSpread(_objectSpread({
413
+ appId: config.appId,
411
414
  log: _apiLog,
412
415
  type: 'api'
413
- });
416
+ }, this.getSystemProfile()), this.getUserProfile())])));
414
417
  }
415
418
  }]);
416
419
  return Track;
@@ -313,10 +313,21 @@ var Track = class {
313
313
  }
314
314
  // 推送接口访问日志
315
315
  static apiLog(apiLog) {
316
- this.pushQueue({
317
- log: apiLog,
318
- type: "api"
319
- });
316
+ const config = this.config;
317
+ navigator.sendBeacon(
318
+ `${this.config.domain}/pousheng-guard/api/analysis/track`,
319
+ import_pako.default.deflate(
320
+ JSON.stringify([
321
+ {
322
+ appId: config.appId,
323
+ log: apiLog,
324
+ type: "api",
325
+ ...this.getSystemProfile(),
326
+ ...this.getUserProfile()
327
+ }
328
+ ])
329
+ )
330
+ );
320
331
  }
321
332
  };
322
333
  // 配置信息
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yysports/tools",
3
- "version": "1.0.6",
3
+ "version": "1.0.7",
4
4
  "description": "常用工具函数库",
5
5
  "homepage": "https://git.pousheng.com/sport-service-department/pousheng-guard/yysports_tools#readme",
6
6
  "bugs": {