chore(client): AppConfig 默认连生产 jiu.51yanmei.com

BASE_URL/PUBLIC_URL/ABOUT_URL 默认值改为线上,flutter run 不带
--dart-define 即连生产;需本地后端时显式 --dart-define 覆盖。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Bupi8Kdqkfx2N5acFsHTx5
This commit is contained in:
wangjia
2026-08-28 02:28:56 +08:00
parent 46302d9e4a
commit 1655769827
+6 -8
View File
@@ -1,22 +1,20 @@
/// 集中管理应用配置,通过 --dart-define=KEY=value 注入环境变量
///
/// 开发默认值http://localhost:8080
/// 生产部署示例flutter run \
/// --dart-define=BASE_URL=http://192.168.1.100:8080 \
/// --dart-define=SHOP_NAME=强朋友名酒行 \
/// --dart-define=SHOP_ADDRESS=贵州省贵阳市云岩区中华北路88号 \
/// --dart-define=SHOP_PHONE=0851-12345678
/// 默认值 = 线上服务(jiu.51yanmei.com):本地 flutter run 不带 define 也连生产。
/// 需连本地后端时显式覆盖flutter run \
/// --dart-define=BASE_URL=http://localhost:8080 \
/// --dart-define=PUBLIC_URL=http://localhost:8081
class AppConfig {
const AppConfig._();
static const _baseUrl = String.fromEnvironment(
'BASE_URL',
defaultValue: 'http://localhost:8080',
defaultValue: 'https://jiu.51yanmei.com',
);
static const _publicUrl = String.fromEnvironment(
'PUBLIC_URL',
defaultValue: 'http://localhost:8081',
defaultValue: 'https://jiu.51yanmei.com',
);
static const shopName = String.fromEnvironment(