fix(app): Flutter Web 开发模式默认连接 localhost:3000 API
- app.dart: kDebugMode 下使用 AppConfig.dev (localhost:3000) - dev.mjs: flutter run 传入 --dart-define API_BASE_URL/SSE_BASE_URL
This commit is contained in:
@@ -308,7 +308,7 @@ async function startApp() {
|
||||
const appDir = resolve(ROOT, "app");
|
||||
const flutterBin = IS_WIN ? "D:\\flutter\\bin\\flutter.bat" : "flutter";
|
||||
|
||||
const child = spawn(`${flutterBin} run -d chrome --web-port=${PORTS.app}`, {
|
||||
const child = spawn(`${flutterBin} run -d chrome --web-port=${PORTS.app} --dart-define=API_BASE_URL=http://localhost:${PORTS.backend}/api/v1 --dart-define=SSE_BASE_URL=http://localhost:${PORTS.backend}/api/v1`, {
|
||||
cwd: appDir,
|
||||
shell: true,
|
||||
stdio: "pipe",
|
||||
|
||||
Reference in New Issue
Block a user