class Config {
  ///获取环境
  static String getEnv() {
    const env = String.fromEnvironment('ENV', defaultValue: 'dev');
    return env;
  }

  ///获取接口地址
  static String baseUrl() {
    if (getEnv() == 'dev') {
      return 'https://xg.test.lifebanktech.com/api';
    } else {
      return 'https://xg.lifebanktech.com/api';
    }
  }

  /// 获取websocket地址
  static String wsUrl() {
    final url = webUrl();
    final wsBase = url.replaceAll('https', 'wss'); // 替换协议
    return '$wsBase/ws';
  }

  ///网页域名地址
  static String webUrl() {
    String url = baseUrl();
    return url.replaceAll("/api", "");
  }

  ///声网APPid
  static String get swAppId => "011c2fd2e1854511a80c1aebded4eee7";
}
