/* eslint-disable no-undef */

let serverUrl;
let h5Origin;
let appKey;
let envValus = NODE_ENV.split('-');
let featuresVersion = envValus[1];
let websoketUrl;
let projectName = envValus[2] || '';

if (featuresVersion === 'enterprise') {
  // serverUrl = 'https://sagacare-h5.tenants.link/api';
  // h5Origin = 'https://sagacare-h5.tenants.link';
  // appKey = '61663db014e22b6a4f1e66b6'; // um 黄色图标小程序
  // websoketUrl = 'wss://sagacare-h5.tenants.link';

  // const serverUrl = 'https://duoduoenv.sagacloud.cn';
  let h5Origin = '';
  let appKey = ''; // um 蓝色图标小程序
  const websoketUrl = '';
} else {
  // 楼板各个项目域名映射
  const ProjectNameDomainMap = {
    // 'jibao': 'bizpace-h5.tenants.link',
    // 'zhijiang': 'zjlab-h5.tenants.link',
    // 'zhangjiang': 'jnb-h5.tenants.link',
    // 'MUSEPoD': 'musepod-h5.tenants.link',
    // 'yueoffice': 'yueoffice-h5.tenants.link',
    // 'zhonghai': 'cooc-h5.tenants.link',
    // 'yintai': 'h5.yintai-foundation.com',
    'jibao': '',
    'zhijiang': '',
    'zhangjiang': '',
    'MUSEPoD': '',
    'yueoffice': '',
    'zhonghai': '',
    'yintai': ''
  }

  // const DefaultDomain = 'jmc-h5.tenants.link'; // 默认域名为嘉铭
  const DefaultDomain = '';
  let projectDomain = DefaultDomain;
  if (projectName && ProjectNameDomainMap[projectName]) {
    projectDomain = ProjectNameDomainMap[projectName];
  }

  serverUrl = `https://duoduoenv.sagacloud.cn`;
  // h5Origin = `https://${projectDomain}`;
  h5Origin = 'http://localhost:8081/';
  websoketUrl = `wss://${projectDomain}`
}

export default {
  serverUrl,
  h5Origin,
  appKey,
  websoketUrl
};
