const protocol = EASY_ENV_IS_BROWSER ? window.location.protocol : 'http';

const hostMap = {
  apiHost: `http://localhost:7002/`,
  // apiHost: `http://192.168.28.199:7001/`,
  // apiHost: 'https://quantum-blocks-yxm.liangkebang.net/',
  h5Host: 'https://quantum-h5-yxm.liangkebang.net',
  qiniuHost: `https://appsync.lkbang.net`,
  shenceUrl: `${protocol}//bn.xyqb.com/sa?project=default`,
  opapiHost: `https://opapi-yxm.liangkebang.net`,
  qiniuUpHost: `${protocol}//up-z0.qiniup.com`,
  // kdspHost: 'https://kdsp-api-yxm.liangkebang.net',
  talosHost: 'https://talos-yxm.liangkebang.net',
  kdspHost: 'https://kdsp-api-yxm.liangkebang.net',
  yxmTenantId: 560761,
  appIdMap: {
    560761: 'wxe16bf9293671506c',
    560867: 'wxccb8435d68e8c7d6',
  },
};

if (EASY_ENV_IS_BROWSER) {
  const apolloCfg = window.apollo || window.__INITIAL_STATE__.apollo;
  if (apolloCfg) {
    for (const key in apolloCfg) {
      if (apolloCfg[key]) {
        hostMap[key] = apolloCfg[key];
      }
    }
  }
}

export default hostMap;
