@tmsfe/tms-core 0.0.204 → 0.0.206

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.204",
3
+ "version": "0.0.206",
4
4
  "description": "tms运行时框架",
5
5
  "repository": {
6
6
  "type": "git",
@@ -4,7 +4,6 @@
4
4
  */
5
5
 
6
6
  import clone from './clone';
7
- import { getSystemInfoSync } from '../wxApi';
8
7
  import {
9
8
  IPage,
10
9
  DataItem,
@@ -43,7 +42,7 @@ let systemInfo: ISystemInfo;
43
42
  */
44
43
  function getSystemInfo(): ISystemInfo {
45
44
  if (!systemInfo) {
46
- const currentSystemInfo = getSystemInfoSync() as any;
45
+ const currentSystemInfo = wx.getSystemInfoSync() as any;
47
46
  // eslint-disable-next-line
48
47
  const { model = '', version: wxVersion = '', platform = '', SDKVersion = '', host } = currentSystemInfo;
49
48
  systemInfo = { model, wxVersion, platform, SDKVersion, host };
@@ -5,7 +5,6 @@
5
5
 
6
6
  import clone from '../clone';
7
7
  import helper from '../helper';
8
- import { getSystemInfoSync } from '../../wxApi';
9
8
  import { IInitOptions, IBindEvent } from './types';
10
9
 
11
10
  let initOptions: IInitOptions;
@@ -31,11 +30,16 @@ function fastReportData(...args: any[]): any {
31
30
  initOptions.fastReport(...args);
32
31
  }
33
32
 
33
+ let systemInfo: WechatMiniprogram.SystemInfo;
34
+
34
35
  /**
35
36
  * 获取wx.getSystemInfoSync()
36
37
  */
37
38
  function getSystemInfo(): any {
38
- return getSystemInfoSync();
39
+ if (!systemInfo) {
40
+ systemInfo = wx.getSystemInfoSync();
41
+ }
42
+ return systemInfo;
39
43
  }
40
44
 
41
45
  let lastBindEvent: IBindEvent;