fix(app): Flutter Web 开发模式默认连接 localhost:3000 API
Some checks failed
Main Merge / backend (push) Has been cancelled
Main Merge / frontend (push) Has been cancelled

- app.dart: kDebugMode 下使用 AppConfig.dev (localhost:3000)
- dev.mjs: flutter run 传入 --dart-define API_BASE_URL/SSE_BASE_URL
This commit is contained in:
iven
2026-06-03 17:50:55 +08:00
parent 8300822232
commit 4cd381295a
2 changed files with 4 additions and 3 deletions

View File

@@ -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",