@tmsfe/tms-core 0.0.37 → 0.0.40

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tmsfe/tms-core",
3
- "version": "0.0.37",
3
+ "version": "0.0.40",
4
4
  "description": "tms运行时框架",
5
5
  "repository": {
6
6
  "type": "git",
@@ -12,6 +12,7 @@ function getBaseData(deviceData: IDeviceData): DataItem[] {
12
12
  const arr = new Array<string>(helper.dataArrLen);
13
13
  const { networkType, location } = deviceData;
14
14
  const { appVersion, client } = helper.getInitOptions();
15
+ const { host } = helper.getSystemInfo();
15
16
  // todo: 如何区分新旧埋点?新:f20不为空,旧:f20为空
16
17
  // ++++++++++++++++++++++++++字段列表++++++++++++++++++++++++++
17
18
  // 0: log_time,日志入库时间
@@ -42,7 +43,7 @@ function getBaseData(deviceData: IDeviceData): DataItem[] {
42
43
  // 18: f18,city - 城市
43
44
  arr[18] = location.cityName;
44
45
  // 19: f19,当前小程序运行的宿主环境
45
- arr[19] = helper.getSystemInfo().host;
46
+ arr[19] = helper.convert2String(host);
46
47
  // 28: f28,sinan、mycar等
47
48
  arr[28] = client;
48
49
  // 29: f29,小程序场景值
@@ -117,11 +117,6 @@ function getAppScene(): string {
117
117
  return scene.toString();
118
118
  }
119
119
 
120
- // 给非空字段都encodeURIComponent一下
121
- function encodeItems(arr: DataItem[]): DataItem[] {
122
- return arr.map(t => (t ? encodeURIComponent(t) : t));
123
- }
124
-
125
120
  // 是否爬虫
126
121
  let isCrawler: boolean | null = null;
127
122
 
@@ -207,7 +202,6 @@ function getDeviceData(): Promise<IDeviceData> {
207
202
  export default {
208
203
  init,
209
204
  getTms,
210
- encodeItems,
211
205
  getInitOptions,
212
206
  getSystemInfo,
213
207
  getSystemInfoString,
@@ -73,7 +73,7 @@ function requestFail(batch: DataItem[][]): void {
73
73
  */
74
74
  function send(arr: DataItem[]): void {
75
75
  stopTimer();
76
- cacheArr.unshift(helper.encodeItems(arr)); // 如果队列中很多,排前面比较稳妥
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(helper.encodeItems(arr));
85
+ cacheArr.push(arr);
86
86
  checkQueue(false);
87
87
  }
88
88
 
@@ -28,9 +28,9 @@ interface IOldParams {
28
28
  interface ISystemInfo {
29
29
  model: string,
30
30
  wxVersion: string,
31
- platform: '',
32
- SDKVersion: '',
33
- host: '',
31
+ platform: string,
32
+ SDKVersion: string,
33
+ host: object | '',
34
34
  }
35
35
 
36
36
  interface ILocation {