@yysports/tools 1.0.1 → 1.0.2
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.d.ts +1 -0
- package/dist/Track/index.js +16 -2
- package/lib/Track/index.d.ts +1 -0
- package/lib/Track/index.js +14 -0
- package/package.json +1 -1
package/dist/Track/index.d.ts
CHANGED
|
@@ -14,6 +14,7 @@ declare class Track {
|
|
|
14
14
|
static setUserProfile(userProfile: UserProfile): void;
|
|
15
15
|
static initAuthCenterData({ getAuth, menuBuild, getDataScopeZonePermissions, menuNameMap, routes, }: Pick<TrackConfig, 'getAuth' | 'menuBuild' | 'menuNameMap' | 'routes' | 'getDataScopeZonePermissions'>): Promise<AuthCenterUserProfile>;
|
|
16
16
|
static init({ userProfile, menuNameMap, routes, getAuth, menuBuild, getDataScopeZonePermissions, ...restConfig }: TrackConfig): Promise<AuthCenterUserProfile>;
|
|
17
|
+
static registerAppInfo(): void;
|
|
17
18
|
static pushQueue({ type, log, }: {
|
|
18
19
|
type: TrackType;
|
|
19
20
|
log: ErrorProfile | CustomizeProfile;
|
package/dist/Track/index.js
CHANGED
|
@@ -272,8 +272,11 @@ var Track = /*#__PURE__*/function () {
|
|
|
272
272
|
}
|
|
273
273
|
this.setUserProfile(currentUserProfile);
|
|
274
274
|
this.mountAutoTask();
|
|
275
|
+
|
|
276
|
+
// 注册应用版本
|
|
277
|
+
this.registerAppInfo();
|
|
275
278
|
return _context3.abrupt("return", this.authCenterUserProfile);
|
|
276
|
-
case
|
|
279
|
+
case 13:
|
|
277
280
|
case "end":
|
|
278
281
|
return _context3.stop();
|
|
279
282
|
}
|
|
@@ -283,7 +286,18 @@ var Track = /*#__PURE__*/function () {
|
|
|
283
286
|
return _init.apply(this, arguments);
|
|
284
287
|
}
|
|
285
288
|
return init;
|
|
286
|
-
}() //
|
|
289
|
+
}() // 注册更新应用信息
|
|
290
|
+
}, {
|
|
291
|
+
key: "registerAppInfo",
|
|
292
|
+
value: function registerAppInfo() {
|
|
293
|
+
var appId = this.config.appId;
|
|
294
|
+
navigator.sendBeacon("https://track.yysports.com/pousheng-guard/api/conf/updateAppVersion", pako.deflate(JSON.stringify({
|
|
295
|
+
appId: appId,
|
|
296
|
+
version: VERSION
|
|
297
|
+
})));
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
// 推送埋点信息进入队列
|
|
287
301
|
}, {
|
|
288
302
|
key: "pushQueue",
|
|
289
303
|
value: function pushQueue(_ref4) {
|
package/lib/Track/index.d.ts
CHANGED
|
@@ -14,6 +14,7 @@ declare class Track {
|
|
|
14
14
|
static setUserProfile(userProfile: UserProfile): void;
|
|
15
15
|
static initAuthCenterData({ getAuth, menuBuild, getDataScopeZonePermissions, menuNameMap, routes, }: Pick<TrackConfig, 'getAuth' | 'menuBuild' | 'menuNameMap' | 'routes' | 'getDataScopeZonePermissions'>): Promise<AuthCenterUserProfile>;
|
|
16
16
|
static init({ userProfile, menuNameMap, routes, getAuth, menuBuild, getDataScopeZonePermissions, ...restConfig }: TrackConfig): Promise<AuthCenterUserProfile>;
|
|
17
|
+
static registerAppInfo(): void;
|
|
17
18
|
static pushQueue({ type, log, }: {
|
|
18
19
|
type: TrackType;
|
|
19
20
|
log: ErrorProfile | CustomizeProfile;
|
package/lib/Track/index.js
CHANGED
|
@@ -210,8 +210,22 @@ var Track = class {
|
|
|
210
210
|
}
|
|
211
211
|
this.setUserProfile(currentUserProfile);
|
|
212
212
|
this.mountAutoTask();
|
|
213
|
+
this.registerAppInfo();
|
|
213
214
|
return this.authCenterUserProfile;
|
|
214
215
|
}
|
|
216
|
+
// 注册更新应用信息
|
|
217
|
+
static registerAppInfo() {
|
|
218
|
+
const { appId } = this.config;
|
|
219
|
+
navigator.sendBeacon(
|
|
220
|
+
`https://track.yysports.com/pousheng-guard/api/conf/updateAppVersion`,
|
|
221
|
+
import_pako.default.deflate(
|
|
222
|
+
JSON.stringify({
|
|
223
|
+
appId,
|
|
224
|
+
version: VERSION
|
|
225
|
+
})
|
|
226
|
+
)
|
|
227
|
+
);
|
|
228
|
+
}
|
|
215
229
|
// 推送埋点信息进入队列
|
|
216
230
|
static pushQueue({
|
|
217
231
|
type,
|