wupengfei
2 天以前 ea408eac6343066edcd8ca18117794442b64b545
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
const n =
    'undefined' !== typeof wx &&
    'function' === typeof wx.getSystemInfoSync &&
    Boolean(wx.getSystemInfoSync().fontSizeSetting),
  e = 'undefined' !== typeof window.uni && 'undefined' === typeof window,
  t = n || e,
  i = 'undefined' !== typeof window.uni,
  o = ('undefined' !== typeof window.uni || 'undefined' !== typeof window) && !t,
  d = n ? wx : i ? window.uni : window,
  f = (o && window && window.navigator && window.navigator.userAgent) || '',
  w = /Android/i.test(f),
  s = /(?:Windows Phone)/.test(f),
  u = /(?:SymbianOS)/.test(f),
  a = /iPad/i.test(f) || /iPhone/i.test(f) || /iPod/i.test(f),
  y = n,
  p = w || s || u || a,
  S = o && !p,
  c = e && !n;
function r() {
  let n = '';
  return S ? (n = 'pc') : p ? (n = 'h5') : y ? (n = 'wechat') : c && (n = 'app'), n;
}
export { d as TUIGlobal, r as getPlatform };