@yysports/tools 0.0.5 → 0.0.6

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.
@@ -224,16 +224,27 @@ var Track = /*#__PURE__*/function () {
224
224
  }, {
225
225
  key: "eventLog",
226
226
  value: function eventLog(_eventLog) {
227
+ var copyEventLog = {
228
+ module: '',
229
+ content: ''
230
+ };
227
231
  if (typeof _eventLog === 'string') {
228
232
  var _CurrentUser$authMap;
233
+ var actionLog = (_CurrentUser$authMap = CurrentUser.authMap) === null || _CurrentUser$authMap === void 0 ? void 0 : _CurrentUser$authMap[_eventLog];
234
+ if (actionLog) {
235
+ copyEventLog.content = '触发: ' + actionLog;
236
+ } else {
237
+ copyEventLog.content = _eventLog;
238
+ }
239
+ } else {
240
+ Object.assign(copyEventLog, _eventLog);
241
+ }
242
+ if (!copyEventLog.module) {
229
243
  var routeNames = this.getPageModuleName();
230
- _eventLog = {
231
- module: routeNames.join('-'),
232
- content: '触发: ' + ((_CurrentUser$authMap = CurrentUser.authMap) === null || _CurrentUser$authMap === void 0 ? void 0 : _CurrentUser$authMap[_eventLog])
233
- };
244
+ copyEventLog.module = (routeNames === null || routeNames === void 0 ? void 0 : routeNames.join('-')) || '-';
234
245
  }
235
246
  this.pushQueue({
236
- log: _eventLog,
247
+ log: copyEventLog,
237
248
  type: 'event'
238
249
  });
239
250
  }
@@ -25,7 +25,7 @@ export interface SystemProfile {
25
25
  }
26
26
  export interface CustomizeProfile {
27
27
  content: string;
28
- module: string;
28
+ module?: string;
29
29
  [key: string]: any;
30
30
  }
31
31
  export interface ErrorProfile {
@@ -171,15 +171,26 @@ var Track = class {
171
171
  // 推送用户触发日志
172
172
  static eventLog(eventLog) {
173
173
  var _a;
174
+ const copyEventLog = {
175
+ module: "",
176
+ content: ""
177
+ };
174
178
  if (typeof eventLog === "string") {
179
+ const actionLog = (_a = import_CurrentUser.default.authMap) == null ? void 0 : _a[eventLog];
180
+ if (actionLog) {
181
+ copyEventLog.content = "触发: " + actionLog;
182
+ } else {
183
+ copyEventLog.content = eventLog;
184
+ }
185
+ } else {
186
+ Object.assign(copyEventLog, eventLog);
187
+ }
188
+ if (!copyEventLog.module) {
175
189
  const routeNames = this.getPageModuleName();
176
- eventLog = {
177
- module: routeNames.join("-"),
178
- content: "触发: " + ((_a = import_CurrentUser.default.authMap) == null ? void 0 : _a[eventLog])
179
- };
190
+ copyEventLog.module = (routeNames == null ? void 0 : routeNames.join("-")) || "-";
180
191
  }
181
192
  this.pushQueue({
182
- log: eventLog,
193
+ log: copyEventLog,
183
194
  type: "event"
184
195
  });
185
196
  }
@@ -25,7 +25,7 @@ export interface SystemProfile {
25
25
  }
26
26
  export interface CustomizeProfile {
27
27
  content: string;
28
- module: string;
28
+ module?: string;
29
29
  [key: string]: any;
30
30
  }
31
31
  export interface ErrorProfile {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yysports/tools",
3
- "version": "0.0.5",
3
+ "version": "0.0.6",
4
4
  "description": "常用工具函数库",
5
5
  "homepage": "https://git.pousheng.com/sport-service-department/pousheng-guard/yysports_tools#readme",
6
6
  "bugs": {