@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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tmsfe/tms-core",
3
- "version": "0.0.36",
3
+ "version": "0.0.39",
4
4
  "description": "tms运行时框架",
5
5
  "repository": {
6
6
  "type": "git",
@@ -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 = '' } = system;
41
- systemInfo = { model, wxVersion, platform, SDKVersion, host };
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,
@@ -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: string,
34
34
  }
35
35
 
36
36
  interface ILocation {