@tmsfe/tms-core 0.0.52 → 0.0.53
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/package.json +1 -1
- package/src/report/formatV2.ts +3 -1
- package/src/report/helper.ts +13 -0
package/package.json
CHANGED
package/src/report/formatV2.ts
CHANGED
|
@@ -56,7 +56,9 @@ function getBaseData(deviceData: IDeviceData): { arr: DataItem[], nextIndex: num
|
|
|
56
56
|
arr[24] = JSON.stringify(page?.options);
|
|
57
57
|
// 25: f25,当前页面深度
|
|
58
58
|
arr[25] = pageDepth.toString();
|
|
59
|
-
// 26
|
|
59
|
+
// 26: f26,一次小程序生命周期中的埋点统一标记
|
|
60
|
+
arr[26] = helper.getLifeReportKey();
|
|
61
|
+
// 27 ~ 30: 预留字段给后续扩展使用
|
|
60
62
|
// 31 ~ 40: 提供给开发自定义
|
|
61
63
|
// --------------------------字段列表--------------------------
|
|
62
64
|
return { arr, nextIndex: 31 };
|
package/src/report/helper.ts
CHANGED
|
@@ -102,6 +102,18 @@ function getNowString(): string {
|
|
|
102
102
|
return `${year}${month}${day}${hours}${minutes}${seconds}${ms}`;
|
|
103
103
|
}
|
|
104
104
|
|
|
105
|
+
let lifeReportKey = '';
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* 一次小程序生命周期中的埋点统一标记
|
|
109
|
+
*/
|
|
110
|
+
function getLifeReportKey(): string {
|
|
111
|
+
if (lifeReportKey === '') {
|
|
112
|
+
lifeReportKey = getNowString();
|
|
113
|
+
}
|
|
114
|
+
return lifeReportKey;
|
|
115
|
+
}
|
|
116
|
+
|
|
105
117
|
/**
|
|
106
118
|
* 获取当前页面信息
|
|
107
119
|
*/
|
|
@@ -228,6 +240,7 @@ export default {
|
|
|
228
240
|
getSystemInfoString,
|
|
229
241
|
convert2String,
|
|
230
242
|
getNowString,
|
|
243
|
+
getLifeReportKey,
|
|
231
244
|
getPageInfo,
|
|
232
245
|
getLaunchOptionsString,
|
|
233
246
|
getLaunchFrom,
|