Files
social-app/apps/lib/core/config/env.dart
T
qzl 01c36eb32e refactor: 移除前端 Mock API,新增共享组件,优化认证流程
- 删除 mock_api_client、mock_calendar_service、mock_history_service
- 新增 fixed_length_code_input、link_button、message_composer 共享组件
- 优化登录/注册/密码重置页面使用新组件
- 简化 injection.dart 移除 mock 分支
- 更新 env.dart 配置(BACKEND_URL 替换 API_URL)
- 后端 agentscope 工具和测试更新
- 重构 AGENTS.md 文档结构
- 新增 deploy/ 目录和 protocol 文档
2026-03-12 16:41:45 +08:00

23 lines
528 B
Dart

import 'dart:io';
class Env {
static String get apiUrl {
final backendUrl = const String.fromEnvironment('BACKEND_URL');
if (backendUrl.isNotEmpty && backendUrl != 'false') {
return backendUrl;
}
if (Platform.isAndroid) {
return 'http://192.168.1.25:5775';
}
return 'http://localhost:5775';
}
static bool get isMockApi {
final fromDefine = const String.fromEnvironment('MOCK_API');
if (fromDefine.isNotEmpty) {
return fromDefine == 'true';
}
return false;
}
}