@yysports/tools 1.0.6 → 1.1.0
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.
- package/dist/Track/index.js +7 -4
- package/lib/Track/index.js +17 -6
- package/package.json +1 -1
package/dist/Track/index.js
CHANGED
|
@@ -62,7 +62,7 @@ var Track = /*#__PURE__*/function () {
|
|
|
62
62
|
compressed = pako.deflate(JSON.stringify(data));
|
|
63
63
|
if (data.length) {
|
|
64
64
|
debug && console.debug('[track:debug] push data', data);
|
|
65
|
-
navigator.sendBeacon("".concat(this.config.domain, "/pousheng-guard/api/
|
|
65
|
+
navigator.sendBeacon("".concat(this.config.domain, "/pousheng-guard/api/track"), compressed);
|
|
66
66
|
}
|
|
67
67
|
case 4:
|
|
68
68
|
case "end":
|
|
@@ -295,7 +295,7 @@ var Track = /*#__PURE__*/function () {
|
|
|
295
295
|
key: "registerAppInfo",
|
|
296
296
|
value: function registerAppInfo() {
|
|
297
297
|
var appId = this.config.appId;
|
|
298
|
-
navigator.sendBeacon("".concat(this.config.domain, "/pousheng-guard/api/
|
|
298
|
+
navigator.sendBeacon("".concat(this.config.domain, "/pousheng-guard/api/apps/version/update"), pako.deflate(JSON.stringify({
|
|
299
299
|
appId: appId,
|
|
300
300
|
version: version
|
|
301
301
|
})));
|
|
@@ -407,10 +407,13 @@ var Track = /*#__PURE__*/function () {
|
|
|
407
407
|
}, {
|
|
408
408
|
key: "apiLog",
|
|
409
409
|
value: function apiLog(_apiLog) {
|
|
410
|
-
|
|
410
|
+
// API 日志无需等待队列,直接发送
|
|
411
|
+
var config = this.config;
|
|
412
|
+
navigator.sendBeacon("".concat(this.config.domain, "/pousheng-guard/api/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;
|
package/lib/Track/index.js
CHANGED
|
@@ -57,7 +57,7 @@ var Track = class {
|
|
|
57
57
|
if (data.length) {
|
|
58
58
|
debug && console.debug("[track:debug] push data", data);
|
|
59
59
|
navigator.sendBeacon(
|
|
60
|
-
`${this.config.domain}/pousheng-guard/api/
|
|
60
|
+
`${this.config.domain}/pousheng-guard/api/track`,
|
|
61
61
|
compressed
|
|
62
62
|
);
|
|
63
63
|
}
|
|
@@ -221,7 +221,7 @@ var Track = class {
|
|
|
221
221
|
static registerAppInfo() {
|
|
222
222
|
const { appId } = this.config;
|
|
223
223
|
navigator.sendBeacon(
|
|
224
|
-
`${this.config.domain}/pousheng-guard/api/
|
|
224
|
+
`${this.config.domain}/pousheng-guard/api/apps/version/update`,
|
|
225
225
|
import_pako.default.deflate(
|
|
226
226
|
JSON.stringify({
|
|
227
227
|
appId,
|
|
@@ -313,10 +313,21 @@ var Track = class {
|
|
|
313
313
|
}
|
|
314
314
|
// 推送接口访问日志
|
|
315
315
|
static apiLog(apiLog) {
|
|
316
|
-
this.
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
316
|
+
const config = this.config;
|
|
317
|
+
navigator.sendBeacon(
|
|
318
|
+
`${this.config.domain}/pousheng-guard/api/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
|
// 配置信息
|