@yysports/tools 1.0.3 → 1.0.5
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/README.md
CHANGED
|
@@ -3,11 +3,4 @@
|
|
|
3
3
|
[](https://npmjs.org/package/@yysports/tools)
|
|
4
4
|
[](https://npmjs.org/package/@yysports/tools)
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
### 1.0.0
|
|
9
|
-
|
|
10
|
-
`2025-07-15`
|
|
11
|
-
|
|
12
|
-
- 🆕 用户信息增加人资组织编码 orgCode
|
|
13
|
-
- 🆕 用户信息增加权限中心配置的部门数据权限 dataScopeZonePermissions
|
|
6
|
+
[阅读文档](https://track.yysports.com/yysports-tools)
|
package/dist/Track/index.js
CHANGED
|
@@ -25,6 +25,7 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
|
|
|
25
25
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
26
26
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
27
27
|
import pako from 'pako';
|
|
28
|
+
import { version } from "../../package.json";
|
|
28
29
|
import { generateRandomString, getAuthMapByAuthCenter, getRoutesMap } from "../Utils";
|
|
29
30
|
var Track = /*#__PURE__*/function () {
|
|
30
31
|
function Track() {
|
|
@@ -38,6 +39,9 @@ var Track = /*#__PURE__*/function () {
|
|
|
38
39
|
if (!config) {
|
|
39
40
|
throw new Error('请配置Track');
|
|
40
41
|
}
|
|
42
|
+
if (!config.domain) {
|
|
43
|
+
throw new Error('请设置信息采集中心域名');
|
|
44
|
+
}
|
|
41
45
|
if (!config.appId) {
|
|
42
46
|
throw new Error('请设置appId');
|
|
43
47
|
}
|
|
@@ -58,7 +62,7 @@ var Track = /*#__PURE__*/function () {
|
|
|
58
62
|
compressed = pako.deflate(JSON.stringify(data));
|
|
59
63
|
if (data.length) {
|
|
60
64
|
debug && console.debug('[track:debug] push data', data);
|
|
61
|
-
navigator.sendBeacon("
|
|
65
|
+
navigator.sendBeacon("//".concat(this.config.domain, "/pousheng-guard/api/analysis/track"), compressed);
|
|
62
66
|
}
|
|
63
67
|
case 4:
|
|
64
68
|
case "end":
|
|
@@ -274,9 +278,9 @@ var Track = /*#__PURE__*/function () {
|
|
|
274
278
|
this.mountAutoTask();
|
|
275
279
|
|
|
276
280
|
// 注册应用版本
|
|
277
|
-
|
|
281
|
+
this.registerAppInfo();
|
|
278
282
|
return _context3.abrupt("return", this.authCenterUserProfile);
|
|
279
|
-
case
|
|
283
|
+
case 13:
|
|
280
284
|
case "end":
|
|
281
285
|
return _context3.stop();
|
|
282
286
|
}
|
|
@@ -291,9 +295,9 @@ var Track = /*#__PURE__*/function () {
|
|
|
291
295
|
key: "registerAppInfo",
|
|
292
296
|
value: function registerAppInfo() {
|
|
293
297
|
var appId = this.config.appId;
|
|
294
|
-
navigator.sendBeacon("
|
|
298
|
+
navigator.sendBeacon("//".concat(this.config.domain, "/pousheng-guard/api/conf/updateAppVersion"), pako.deflate(JSON.stringify({
|
|
295
299
|
appId: appId,
|
|
296
|
-
version:
|
|
300
|
+
version: version
|
|
297
301
|
})));
|
|
298
302
|
}
|
|
299
303
|
|
package/lib/Track/index.js
CHANGED
|
@@ -33,6 +33,7 @@ __export(Track_exports, {
|
|
|
33
33
|
});
|
|
34
34
|
module.exports = __toCommonJS(Track_exports);
|
|
35
35
|
var import_pako = __toESM(require("pako"));
|
|
36
|
+
var import_package = require("../../package.json");
|
|
36
37
|
var import_Utils = require("../Utils");
|
|
37
38
|
var Track = class {
|
|
38
39
|
// 检查必填配置项
|
|
@@ -40,6 +41,9 @@ var Track = class {
|
|
|
40
41
|
if (!config) {
|
|
41
42
|
throw new Error("请配置Track");
|
|
42
43
|
}
|
|
44
|
+
if (!config.domain) {
|
|
45
|
+
throw new Error("请设置信息采集中心域名");
|
|
46
|
+
}
|
|
43
47
|
if (!config.appId) {
|
|
44
48
|
throw new Error("请设置appId");
|
|
45
49
|
}
|
|
@@ -53,7 +57,7 @@ var Track = class {
|
|
|
53
57
|
if (data.length) {
|
|
54
58
|
debug && console.debug("[track:debug] push data", data);
|
|
55
59
|
navigator.sendBeacon(
|
|
56
|
-
|
|
60
|
+
`//${this.config.domain}/pousheng-guard/api/analysis/track`,
|
|
57
61
|
compressed
|
|
58
62
|
);
|
|
59
63
|
}
|
|
@@ -210,17 +214,18 @@ var Track = class {
|
|
|
210
214
|
}
|
|
211
215
|
this.setUserProfile(currentUserProfile);
|
|
212
216
|
this.mountAutoTask();
|
|
217
|
+
this.registerAppInfo();
|
|
213
218
|
return this.authCenterUserProfile;
|
|
214
219
|
}
|
|
215
220
|
// 注册更新应用信息
|
|
216
221
|
static registerAppInfo() {
|
|
217
222
|
const { appId } = this.config;
|
|
218
223
|
navigator.sendBeacon(
|
|
219
|
-
|
|
224
|
+
`//${this.config.domain}/pousheng-guard/api/conf/updateAppVersion`,
|
|
220
225
|
import_pako.default.deflate(
|
|
221
226
|
JSON.stringify({
|
|
222
227
|
appId,
|
|
223
|
-
version:
|
|
228
|
+
version: import_package.version
|
|
224
229
|
})
|
|
225
230
|
)
|
|
226
231
|
);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yysports/tools",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.5",
|
|
4
4
|
"description": "常用工具函数库",
|
|
5
5
|
"homepage": "https://git.pousheng.com/sport-service-department/pousheng-guard/yysports_tools#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -64,25 +64,25 @@
|
|
|
64
64
|
"pako": "^2.1.0"
|
|
65
65
|
},
|
|
66
66
|
"devDependencies": {
|
|
67
|
-
"@ant-design/pro-components": "^2.8.
|
|
67
|
+
"@ant-design/pro-components": "^2.8.10",
|
|
68
68
|
"@commitlint/cli": "^19.8.1",
|
|
69
69
|
"@commitlint/config-conventional": "^19.8.1",
|
|
70
70
|
"@types/pako": "^2.0.3",
|
|
71
71
|
"@types/react": "^18.3.23",
|
|
72
72
|
"@types/react-dom": "^18.3.7",
|
|
73
73
|
"@umijs/lint": "^4.4.11",
|
|
74
|
-
"antd": "^5.26.
|
|
74
|
+
"antd": "^5.26.6",
|
|
75
75
|
"dumi": "^2.4.21",
|
|
76
76
|
"eslint": "^9.31.0",
|
|
77
77
|
"father": "^4.6.1",
|
|
78
78
|
"husky": "^9.1.7",
|
|
79
79
|
"lint-staged": "^16.1.2",
|
|
80
80
|
"prettier": "^3.6.2",
|
|
81
|
-
"prettier-plugin-organize-imports": "^4.
|
|
82
|
-
"prettier-plugin-packagejson": "^2.5.
|
|
81
|
+
"prettier-plugin-organize-imports": "^4.2.0",
|
|
82
|
+
"prettier-plugin-packagejson": "^2.5.19",
|
|
83
83
|
"react": "^18.3.1",
|
|
84
84
|
"react-dom": "^18.3.1",
|
|
85
|
-
"stylelint": "^16.
|
|
85
|
+
"stylelint": "^16.22.0"
|
|
86
86
|
},
|
|
87
87
|
"publishConfig": {
|
|
88
88
|
"access": "public"
|