@tmsfe/tms-core 0.0.104 → 0.0.106
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/config.js +17 -2
- package/src/report/formatV2.ts +3 -2
- package/tsconfig.json +31 -0
package/package.json
CHANGED
package/src/config.js
CHANGED
|
@@ -115,8 +115,23 @@ function getApolloConfig(configPath, extendAttr = {}, defaultCfg) {
|
|
|
115
115
|
const { errCode, resData = {} } = res || {};
|
|
116
116
|
const { status, msg, data } = resData;
|
|
117
117
|
if (errCode === 0 && status === 0) {
|
|
118
|
-
return data
|
|
119
|
-
|
|
118
|
+
return data
|
|
119
|
+
.sort((a, b) =>
|
|
120
|
+
// eslint-disable-next-line implicit-arrow-linebreak
|
|
121
|
+
configPaths.findIndex(configPath => configPath === a.configKey)
|
|
122
|
+
- configPaths.findIndex(configPath => configPath === b.configKey))
|
|
123
|
+
.map((item) => {
|
|
124
|
+
const newItem = {
|
|
125
|
+
...item.content,
|
|
126
|
+
};
|
|
127
|
+
Object.keys(item).forEach((key) => {
|
|
128
|
+
if (key !== 'content') {
|
|
129
|
+
newItem[`_${key}`] = item[key];
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
return newItem;
|
|
133
|
+
});
|
|
134
|
+
};
|
|
120
135
|
throw new Error(msg);
|
|
121
136
|
})
|
|
122
137
|
.catch((e) => {
|
package/src/report/formatV2.ts
CHANGED
|
@@ -16,9 +16,10 @@ function getBaseData(page: IPage, deviceData: IDeviceData): { arr: DataItem[], n
|
|
|
16
16
|
// todo: 如何区分新旧埋点?新:f20不为空,旧:f20为空
|
|
17
17
|
// ++++++++++++++++++++++++++字段列表++++++++++++++++++++++++++
|
|
18
18
|
// 0: log_time,日志入库时间
|
|
19
|
-
// 1: access_time
|
|
19
|
+
// 1: access_time,埋点触发时间,如:20221207103148178
|
|
20
20
|
arr[1] = helper.getNowString();
|
|
21
|
-
// 2: user_ip
|
|
21
|
+
// 2: user_ip,埋点触发时间戳,如:1670558265525
|
|
22
|
+
arr[2] = Date.now();
|
|
22
23
|
// 3: qimei,灯塔中的用户ID
|
|
23
24
|
// 4: imei,Android手机的imei IOS系统中的idfv 车联网中的wecarid
|
|
24
25
|
// 5: user_id,用户ID
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"sourceMap": false,
|
|
4
|
+
"target": "esnext",
|
|
5
|
+
"module": "esnext",
|
|
6
|
+
"moduleResolution": "node",
|
|
7
|
+
"allowJs": true,
|
|
8
|
+
"strict": false,
|
|
9
|
+
"declarationMap": false,
|
|
10
|
+
"noUnusedLocals": false,
|
|
11
|
+
"experimentalDecorators": true,
|
|
12
|
+
"resolveJsonModule": true,
|
|
13
|
+
"esModuleInterop": true,
|
|
14
|
+
"removeComments": false,
|
|
15
|
+
"jsx": "preserve",
|
|
16
|
+
"lib": ["esnext"],
|
|
17
|
+
"rootDir": ".",
|
|
18
|
+
"typeRoots": [
|
|
19
|
+
"./node_modules/miniprogram-api-typings/types",
|
|
20
|
+
"./../global.d.ts"
|
|
21
|
+
],
|
|
22
|
+
"outDir": "dist",
|
|
23
|
+
"paths": {
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
"include": [
|
|
27
|
+
"src/**/*.js",
|
|
28
|
+
"src/**/*.ts",
|
|
29
|
+
"../../global.d.ts"
|
|
30
|
+
]
|
|
31
|
+
}
|