From 16557698276941596a64e154d30b9b2f5043bcaa Mon Sep 17 00:00:00 2001 From: wangjia <809946525@qq.com> Date: Fri, 28 Aug 2026 02:28:56 +0800 Subject: [PATCH] =?UTF-8?q?chore(client):=20AppConfig=20=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E8=BF=9E=E7=94=9F=E4=BA=A7=20jiu.51yanmei.com?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit BASE_URL/PUBLIC_URL/ABOUT_URL 默认值改为线上,flutter run 不带 --dart-define 即连生产;需本地后端时显式 --dart-define 覆盖。 Co-Authored-By: Claude Opus 4.8 Claude-Session: https://claude.ai/code/session_01Bupi8Kdqkfx2N5acFsHTx5 --- client/lib/core/config/app_config.dart | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/client/lib/core/config/app_config.dart b/client/lib/core/config/app_config.dart index d589c75..fb1f271 100644 --- a/client/lib/core/config/app_config.dart +++ b/client/lib/core/config/app_config.dart @@ -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(