HttpHostManager.ets 607 Bytes
export enum HostEnum {
  /**
   * uat环境url
   */
  HOST_UAT = 'https://pd-apis-uat.pdnews.cn',
  /**
   * 中文端sit环境
   */
  HOST_SIT = 'https://pd-apis-sit.pdnews.cn',
  /**
   * dev环境url
   */
  HOST_DEV = 'https://pd-apis-dev.pdnews.cn',
  /**
   * 正式环境url
   */
  HOST_PRODUCT = 'https://pdapis.pdnews.cn',
}

/**
 * 环境host管理工具类
 */
export class HostManager {
  private static _hostUrl: HostEnum = HostEnum.HOST_PRODUCT;

  static changeHost(host: HostEnum) {
    HostManager._hostUrl = host;
  }

  static getHost(): string {
    return HostManager._hostUrl;
  }
}