refactor(config): 服务地址改为 dev/prod 配置文件与单个环境开关
启动时按环回、局域网、公网顺序探测地址,换网络后会静默切到别处,排查 困难。改为代码内一个布尔开关选择环境,地址分别放在 dev_config.dart 与 prod_config.dart,不再探测;调试条改地址后直接重载,不再重新探测。 release 构建若仍是开发开关会启动即报错,避免线上包连开发机。
This commit is contained in:
1 parent
57f84c45bd
commit
a6d6b66d31
13 files changed
+101
-382
No files matched your search
@@ -18,9 +18,8 @@ void main() {
|
||||
);
|
||||
|
||||
expect(uri.isAbsolute, isTrue);
|
||||
// Uri.parse().toString() 会把 host 规范成小写,而 devHostBaseUrl 里的
|
||||
// Bonjour 名字带大写(jiangdeMacBook-Air.local)—— 比较时统一小写,
|
||||
// 否则会依赖运行平台(flutter test 里 defaultTargetPlatform 默认是 android)
|
||||
// Uri.parse().toString() 会把 host 规范成小写,而开发地址可能带大写
|
||||
// (Bonjour 名字),比较时统一小写,否则会依赖运行平台。
|
||||
expect(
|
||||
uri.toString().toLowerCase(),
|
||||
'${AppConfig.apiBaseUrl}/files/episode/202610/clip.mp4'.toLowerCase(),
|
||||
|
||||
Reference in new issue
Block a user