23 lines
977 B
Dart
23 lines
977 B
Dart
/// 全局配置
|
||
class AppConfig {
|
||
/// 后端地址:iOS 模拟器用 127.0.0.1;Android 模拟器用 10.0.2.2;真机填局域网 IP
|
||
static const String baseUrl = 'http://127.0.0.1:3007';
|
||
|
||
/// 后端返回的相对路径(/workspace/...)拼成完整 URL
|
||
static String resolveUrl(String path) {
|
||
if (path.startsWith('http')) return path;
|
||
return '$baseUrl$path';
|
||
}
|
||
|
||
/// 穿山甲 App ID(空 = 广告未开通,广告位不渲染)
|
||
static const String pangleAppId = '';
|
||
|
||
/// 测试账号:联调/测试用真实用户数据,默认 wenwu901/123456,
|
||
/// 可用 --dart-define=TEST_ACCOUNT=xxx --dart-define=TEST_PASSWORD=xxx 覆盖(build_web.sh 透传环境变量);
|
||
/// 置空则登录页不显示测试登录入口
|
||
static const String testAccount =
|
||
String.fromEnvironment('TEST_ACCOUNT', defaultValue: 'wenwu901');
|
||
static const String testPassword =
|
||
String.fromEnvironment('TEST_PASSWORD', defaultValue: '123456');
|
||
}
|