@tmsfe/tms-core 0.0.36 → 0.0.39
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/helper.ts +3 -10
- package/src/report/sender.ts +2 -2
- package/src/report/types.ts +3 -3
package/package.json
CHANGED
package/src/report/helper.ts
CHANGED
|
@@ -37,8 +37,9 @@ function getSystemInfo(): ISystemInfo {
|
|
|
37
37
|
if (systemInfo === null) {
|
|
38
38
|
const system = syncApi.getSystemInfoSync() as any;
|
|
39
39
|
// eslint-disable-next-line
|
|
40
|
-
const { model = '', version: wxVersion = '', platform = '', SDKVersion = '', host
|
|
41
|
-
|
|
40
|
+
const { model = '', version: wxVersion = '', platform = '', SDKVersion = '', host } = system;
|
|
41
|
+
const hostStr = host ? JSON.stringify(host) : '';
|
|
42
|
+
systemInfo = { model, wxVersion, platform, SDKVersion, host: hostStr };
|
|
42
43
|
}
|
|
43
44
|
return systemInfo;
|
|
44
45
|
}
|
|
@@ -117,13 +118,6 @@ function getAppScene(): string {
|
|
|
117
118
|
return scene.toString();
|
|
118
119
|
}
|
|
119
120
|
|
|
120
|
-
// 给非空字段都encodeURIComponent一下
|
|
121
|
-
function encodeItems(arr: DataItem[]): DataItem[] {
|
|
122
|
-
return arr.map(t => {
|
|
123
|
-
return t ? encodeURIComponent(t) : t;
|
|
124
|
-
});
|
|
125
|
-
}
|
|
126
|
-
|
|
127
121
|
// 是否爬虫
|
|
128
122
|
let isCrawler: boolean | null = null;
|
|
129
123
|
|
|
@@ -209,7 +203,6 @@ function getDeviceData(): Promise<IDeviceData> {
|
|
|
209
203
|
export default {
|
|
210
204
|
init,
|
|
211
205
|
getTms,
|
|
212
|
-
encodeItems,
|
|
213
206
|
getInitOptions,
|
|
214
207
|
getSystemInfo,
|
|
215
208
|
getSystemInfoString,
|
package/src/report/sender.ts
CHANGED
|
@@ -73,7 +73,7 @@ function requestFail(batch: DataItem[][]): void {
|
|
|
73
73
|
*/
|
|
74
74
|
function send(arr: DataItem[]): void {
|
|
75
75
|
stopTimer();
|
|
76
|
-
cacheArr.unshift(
|
|
76
|
+
cacheArr.unshift(arr); // 如果队列中很多,排前面比较稳妥
|
|
77
77
|
batchSendData();
|
|
78
78
|
}
|
|
79
79
|
|
|
@@ -82,7 +82,7 @@ function send(arr: DataItem[]): void {
|
|
|
82
82
|
* @param arr
|
|
83
83
|
*/
|
|
84
84
|
function queue(arr: DataItem[]): void {
|
|
85
|
-
cacheArr.push(
|
|
85
|
+
cacheArr.push(arr);
|
|
86
86
|
checkQueue(false);
|
|
87
87
|
}
|
|
88
88
|
|
package/src/report/types.ts
CHANGED