655c1d366e
- 公开商品页(/product/:uuid)全面重设计:全宽正方形图片轮播、 左右滑动切图、点击放大全屏查看、商品参数含描述、页脚贴底 - 修复 Flutter web 文件上传无反应(path→bytes) - 修复 web 路由空白页(usePathUrlStrategy + 单层 MaterialApp.router) - 二维码 URL 改为从 STORAGE_PUBLIC_URL 环境变量读取 - 新增 PUBLIC_URL dart-define → AppConfig.publicBaseUrl - 新增 CI/CD workflows + NAS runner compose 配置 - seed S001 补充商品描述字段 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
24 lines
748 B
Dart
24 lines
748 B
Dart
/// 集中管理应用配置,通过 --dart-define=BASE_URL=... 注入环境变量
|
|
///
|
|
/// 开发默认值:http://localhost:8080
|
|
/// 生产部署示例:flutter run --dart-define=BASE_URL=http://192.168.1.100:8080
|
|
class AppConfig {
|
|
const AppConfig._();
|
|
|
|
static const _baseUrl = String.fromEnvironment(
|
|
'BASE_URL',
|
|
defaultValue: 'http://localhost:8080',
|
|
);
|
|
|
|
static const _publicUrl = String.fromEnvironment(
|
|
'PUBLIC_URL',
|
|
defaultValue: 'http://localhost:8081',
|
|
);
|
|
|
|
static String get baseUrl => _baseUrl;
|
|
static String get apiBaseUrl => '$_baseUrl/api/v1';
|
|
static String get healthUrl => '$_baseUrl/health';
|
|
static String get versionUrl => '$_baseUrl/version';
|
|
static String get publicBaseUrl => _publicUrl;
|
|
}
|