constant.dart 2.81 KB
import 'package:appframe/config/evn_config.dart';

class Constant {
  /// local server 相关
  /// /////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  ///
  /// 应用内部 http 服务
  static const int localServerPort = 35982;

  // static const String localServerHost = 'appdev-xj.banxiaoer.net';
  static const String localServerHost = '127.0.0.1';

  static const String localServerUrl = 'http://$localServerHost:$localServerPort';

  static const String localFileUrl = 'http://127.0.0.1:$localServerPort';
  static const String localServerTemp = '/temp';
  static const String localServerTempFileUrl = '$localFileUrl$localServerTemp';
  static const String localServerTest = '/test';
  static const String localServerTestFileUrl = '$localFileUrl$localServerTest';

  /// obs 相关
  /// /////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  ///
  /// obs文件分片上传的分片大小:5M
  static const int obsUploadChunkSize = 1024 * 1024 * 5;

  /// obs文件上传的逻辑前缀
  static const String obsLogicPrefix = EnvConfig.env == 'dev' ? 'd2/pridel/user/' : 'p2/unpridel/user/';

  /// 版本相关
  /// /////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  ///
  /// app 版本号规则
  static const String appVersion = '1.0.2512021';

  /// H5的起始终最低版本号规则
  static const String h5Version = '1.0.0';

  /// H5的版本号存储的key
  static const String h5VersionKey = 'h5_version';

  /// 用于显示的H5版本号存储的key
  static const String h5ShowVersionKey = 'h5_show_version';

  /// H5版本号配置文件地址
  static const String configUrl = EnvConfig.env == 'dev'
      ? 'https://bxe-obs.banxiaoer.com/conf/xeapp_conf_dev.json'
      // ? 'http://192.168.2.177/xeapp_conf_dev.json'
      : 'https://bxe-obs.banxiaoer.com/conf/xeapp_conf_pro.json';

  /// 内部 H5 dist 目录
  static const String h5DistDir = 'http_dist_assets';

  /// BASE URL 相关
  /// /////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  ///
  static const String bxeBaseUrl = EnvConfig.env == 'dev' ? 'https://dev.banxiaoer.net' : '';
  static const String iotAppBaseUrl = EnvConfig.env == 'dev' ? 'https://iotapp-dev.banxiaoer.com/iotapp' : '';

  /// IM 相关
  /// /////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  ///
  /// IM SDK
  static const int imSdkAppId = EnvConfig.env == 'dev' ? 1400310691 : 0;
  static const String imClientSecure =
      EnvConfig.env == 'dev' ? 'kM4yqbehB3io9UiLvH6eHvM7xAhfYxoyyaO1tLoHgKltcaI7MZXkUbpFaWdeQIqe' : '';

  /// 测试阶段使用
  static const bool needIM = false;
}