@yysports/tools 2.2.5 → 2.2.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.
- package/dist/Track/Beacon.js +4 -4
- package/dist/Track/Replay.js +5 -1
- package/dist/Utils/route.js +1 -1
- package/lib/Track/Beacon.js +4 -4
- package/lib/Track/Replay.js +3 -0
- package/lib/Utils/route.js +1 -1
- package/package.json +15 -15
package/dist/Track/Beacon.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
2
2
|
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
3
3
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
4
|
-
import
|
|
4
|
+
import packageJson from "../../package.json";
|
|
5
5
|
import Config from "./Config";
|
|
6
6
|
var Beacon = /*#__PURE__*/function () {
|
|
7
7
|
function Beacon() {
|
|
@@ -42,12 +42,12 @@ var Beacon = /*#__PURE__*/function () {
|
|
|
42
42
|
// 获取缓存中的版本信息
|
|
43
43
|
var storageKey = "__TrackVersion__";
|
|
44
44
|
var cachedVersion = localStorage.getItem(storageKey);
|
|
45
|
-
if (cachedVersion !== version) {
|
|
45
|
+
if (cachedVersion !== packageJson.version) {
|
|
46
46
|
this.send({
|
|
47
47
|
appId: Config.data.appId,
|
|
48
|
-
version: version
|
|
48
|
+
version: packageJson.version
|
|
49
49
|
}, '/pousheng-guard/api/apps/version/update');
|
|
50
|
-
localStorage.setItem(storageKey, version);
|
|
50
|
+
localStorage.setItem(storageKey, packageJson.version);
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
53
|
}]);
|
package/dist/Track/Replay.js
CHANGED
|
@@ -39,6 +39,7 @@ var Replay = /*#__PURE__*/function () {
|
|
|
39
39
|
key: "reportSnapshot",
|
|
40
40
|
value: function () {
|
|
41
41
|
var _reportSnapshot = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(errorId) {
|
|
42
|
+
var _this$_stop;
|
|
42
43
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
43
44
|
while (1) switch (_context.prev = _context.next) {
|
|
44
45
|
case 0:
|
|
@@ -57,8 +58,11 @@ var Replay = /*#__PURE__*/function () {
|
|
|
57
58
|
body: JSON.stringify(this._events)
|
|
58
59
|
});
|
|
59
60
|
case 4:
|
|
61
|
+
// 上报完成后停止本次行为的录制,清空事件队列
|
|
62
|
+
(_this$_stop = this._stop) === null || _this$_stop === void 0 || _this$_stop.call(this);
|
|
63
|
+
this._stop = undefined;
|
|
60
64
|
this._events = [];
|
|
61
|
-
case
|
|
65
|
+
case 7:
|
|
62
66
|
case "end":
|
|
63
67
|
return _context.stop();
|
|
64
68
|
}
|
package/dist/Utils/route.js
CHANGED
|
@@ -11,7 +11,7 @@ export var getModuleNameByUmi = function getModuleNameByUmi(onRouteChangeArgs, m
|
|
|
11
11
|
var pathname = location.pathname;
|
|
12
12
|
var routePath = pathname;
|
|
13
13
|
if (basename !== '/') {
|
|
14
|
-
routePath = pathname.replace(basename, '');
|
|
14
|
+
routePath = pathname.replace(basename, '/');
|
|
15
15
|
}
|
|
16
16
|
var currentRouteKey = Object.keys(routes).find(function (v) {
|
|
17
17
|
return routes[v].path === routePath;
|
package/lib/Track/Beacon.js
CHANGED
|
@@ -32,7 +32,7 @@ __export(Beacon_exports, {
|
|
|
32
32
|
default: () => Beacon
|
|
33
33
|
});
|
|
34
34
|
module.exports = __toCommonJS(Beacon_exports);
|
|
35
|
-
var import_package = require("../../package.json");
|
|
35
|
+
var import_package = __toESM(require("../../package.json"));
|
|
36
36
|
var import_Config = __toESM(require("./Config"));
|
|
37
37
|
var Beacon = class {
|
|
38
38
|
// 加入Beacon消息队列,检测超过5条记录时自动发送
|
|
@@ -57,15 +57,15 @@ var Beacon = class {
|
|
|
57
57
|
static updateVersion() {
|
|
58
58
|
const storageKey = `__TrackVersion__`;
|
|
59
59
|
const cachedVersion = localStorage.getItem(storageKey);
|
|
60
|
-
if (cachedVersion !== import_package.version) {
|
|
60
|
+
if (cachedVersion !== import_package.default.version) {
|
|
61
61
|
this.send(
|
|
62
62
|
{
|
|
63
63
|
appId: import_Config.default.data.appId,
|
|
64
|
-
version: import_package.version
|
|
64
|
+
version: import_package.default.version
|
|
65
65
|
},
|
|
66
66
|
"/pousheng-guard/api/apps/version/update"
|
|
67
67
|
);
|
|
68
|
-
localStorage.setItem(storageKey, import_package.version);
|
|
68
|
+
localStorage.setItem(storageKey, import_package.default.version);
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
71
|
};
|
package/lib/Track/Replay.js
CHANGED
|
@@ -60,6 +60,7 @@ var Replay = class {
|
|
|
60
60
|
}
|
|
61
61
|
// 快照
|
|
62
62
|
static async reportSnapshot(errorId) {
|
|
63
|
+
var _a;
|
|
63
64
|
if (!this._stop) {
|
|
64
65
|
return;
|
|
65
66
|
}
|
|
@@ -73,6 +74,8 @@ var Replay = class {
|
|
|
73
74
|
body: JSON.stringify(this._events)
|
|
74
75
|
}
|
|
75
76
|
);
|
|
77
|
+
(_a = this._stop) == null ? void 0 : _a.call(this);
|
|
78
|
+
this._stop = void 0;
|
|
76
79
|
this._events = [];
|
|
77
80
|
}
|
|
78
81
|
};
|
package/lib/Utils/route.js
CHANGED
|
@@ -27,7 +27,7 @@ var getModuleNameByUmi = (onRouteChangeArgs, menuNameMap) => {
|
|
|
27
27
|
const { pathname } = location;
|
|
28
28
|
let routePath = pathname;
|
|
29
29
|
if (basename !== "/") {
|
|
30
|
-
routePath = pathname.replace(basename, "");
|
|
30
|
+
routePath = pathname.replace(basename, "/");
|
|
31
31
|
}
|
|
32
32
|
const currentRouteKey = Object.keys(routes).find(
|
|
33
33
|
(v) => routes[v].path === routePath
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yysports/tools",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.7",
|
|
4
4
|
"description": "常用工具函数库",
|
|
5
5
|
"homepage": "https://git.pousheng.com/sport-service-department/pousheng-guard/yysports_tools#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"url": "git+https://git.pousheng.com/sport-service-department/pousheng-guard/yysports_tools.git"
|
|
12
12
|
},
|
|
13
13
|
"license": "MIT",
|
|
14
|
-
"author": "",
|
|
14
|
+
"author": "daiwenyu",
|
|
15
15
|
"main": "lib/index.js",
|
|
16
16
|
"module": "dist/index.js",
|
|
17
17
|
"types": "dist/index.d.ts",
|
|
@@ -67,23 +67,23 @@
|
|
|
67
67
|
},
|
|
68
68
|
"devDependencies": {
|
|
69
69
|
"@ant-design/pro-components": "^2.8.10",
|
|
70
|
-
"@commitlint/cli": "^20.
|
|
71
|
-
"@commitlint/config-conventional": "^20.
|
|
72
|
-
"@types/react": "^
|
|
73
|
-
"@types/react-dom": "^
|
|
74
|
-
"@umijs/lint": "^4.
|
|
75
|
-
"antd": "^
|
|
70
|
+
"@commitlint/cli": "^20.2.0",
|
|
71
|
+
"@commitlint/config-conventional": "^20.2.0",
|
|
72
|
+
"@types/react": "^19.2.7",
|
|
73
|
+
"@types/react-dom": "^19.2.3",
|
|
74
|
+
"@umijs/lint": "^4.6.8",
|
|
75
|
+
"antd": "^6.1.1",
|
|
76
76
|
"dumi": "^2.4.21",
|
|
77
77
|
"eslint": "^8.57.1",
|
|
78
|
-
"father": "^4.6.
|
|
78
|
+
"father": "^4.6.10",
|
|
79
79
|
"husky": "^9.1.7",
|
|
80
|
-
"lint-staged": "^16.2.
|
|
81
|
-
"prettier": "^3.
|
|
80
|
+
"lint-staged": "^16.2.7",
|
|
81
|
+
"prettier": "^3.7.4",
|
|
82
82
|
"prettier-plugin-organize-imports": "^4.3.0",
|
|
83
|
-
"prettier-plugin-packagejson": "^2.5.
|
|
84
|
-
"react": "^
|
|
85
|
-
"react-dom": "^
|
|
86
|
-
"stylelint": "^16.
|
|
83
|
+
"prettier-plugin-packagejson": "^2.5.20",
|
|
84
|
+
"react": "^19.2.3",
|
|
85
|
+
"react-dom": "^19.2.3",
|
|
86
|
+
"stylelint": "^16.26.1"
|
|
87
87
|
},
|
|
88
88
|
"publishConfig": {
|
|
89
89
|
"access": "public"
|