const JDSDK = jmfe;
JDSDK.registerCode('c1b6c362-f6d0-4ae0-af3a-e26b22865f42')
const getUuid = () => {
    // 获取手机基本信息
    return new Promise((resolve, reject) => {
      let clientArr = ['android', 'iOS', 'ios', 'ipad', 'iphone'];
      let client = '-1';// client 终端客户端类型
      let clientVersion = '-1';// clientVersion 终端客户端版本
      let uuid = '-1';// uuid 终端唯一设备号
      let osVersion = '-1';// osVersion 终端系统版本
      let model = '-1';// model 终端设备机型
      let userAgent = '-1';// userAgent 浏览器userAgent
      console.log(JDSDK,'JDSDKheme1');
      if (JDSDK.isApp('jd')) {
        console.log(JDSDK.isApp('jd'),'进入京东判断');
        console.log(JDSDK.getDeviceInfo,'JDSDK.getDeviceInfo');
        JDSDK.getDeviceInfo().then(res=>{
          console.log(res, '=========res');
          if (clientArr.includes(res.data.systemName)) {
            client = res.data.systemName;
            clientVersion = res.data.appVersion;
            uuid = res.data.uuid;
            osVersion = res.data.systemVersion;
            model = res.data.model;
            userAgent = window.navigator.userAgent;
            resolve({ client, clientVersion, osVersion, uuid, model, userAgent });
          } else {
            resolve({ client, clientVersion, osVersion, uuid, model, userAgent });
          }
        }).catch(err=>{
          console.log(err,'err=>JDSDK.getDeviceInfo');
          resolve({ client, clientVersion, osVersion, uuid, model, userAgent });
        })
      } else {
        console.log(JDSDK.isApp('jd'),'未进入京东判断');
        resolve({ client, clientVersion, osVersion, uuid, model, userAgent });
      }
    })
}

export {
  getUuid
};
