41 lines
1.8 KiB
Dart
41 lines
1.8 KiB
Dart
/// 全局配置常量(域名发现、公共请求头、版本号,对应《01-开发文档》5.5/5.6/5.7)
|
||
class AppConfig {
|
||
AppConfig._();
|
||
|
||
/// App 版本(对应 pubspec version 的 name 部分;version_code 对应 build 号)
|
||
/// ⚠️ 每次发版必须与 pubspec.yaml 的 version 同步递增,否则老用户会一直提示更新
|
||
static const String appVersion = '1.1.7';
|
||
static const int appVersionCode = 9;
|
||
|
||
/// 平台标识(运行时按 iOS/Android 判定,见 platformName)
|
||
static const String platformNameIOS = 'ios';
|
||
static const String platformNameAndroid = 'android';
|
||
|
||
/// 域名发现:DNS TXT 记录域名与兜底域名后缀
|
||
static const String dnsTxtHost = 'txt.256kb.top';
|
||
static const String fallbackDomainSuffix = '_jsnbhh.vip';
|
||
|
||
/// DoH 服务(阿里 / 腾讯),TXT 解析走 JSON API
|
||
static const List<String> dohServers = [
|
||
'https://223.5.5.5/resolve',
|
||
'https://119.29.29.29/dns-query',
|
||
];
|
||
|
||
/// 缓存域名连续失败达到该阈值后,重新走完整发现流程
|
||
static const int domainFailureThreshold = 3;
|
||
|
||
/// 开发调试:--dart-define=API_BASE=http://localhost:8000 可直接指定本地服务,
|
||
/// 跳过域名发现(生产构建不传即走 TXT/兜底逻辑)
|
||
static const String devApiBase = String.fromEnvironment('API_BASE');
|
||
|
||
/// 微信支付 iOS 回跳 Universal Link:
|
||
/// --dart-define=WECHAT_UNIVERSAL_LINK=https://app.256kb.top/wechat
|
||
/// 须与 pubspec.yaml 中 fluwx.ios.universal_link 保持一致;未传时 iOS 端无法回跳
|
||
static const String wechatUniversalLink =
|
||
String.fromEnvironment('WECHAT_UNIVERSAL_LINK');
|
||
|
||
/// 请求超时
|
||
static const Duration connectTimeout = Duration(seconds: 10);
|
||
static const Duration receiveTimeout = Duration(seconds: 20);
|
||
}
|