diff --git a/www/app.js b/www/app.js index 737cd55..77c1e0d 100644 --- a/www/app.js +++ b/www/app.js @@ -78,8 +78,8 @@ function getTodayDate() { // 从后台API加载配置 async function loadBackendConfig() { try { - // 后台服务地址 - const API_BASE = 'http://localhost:19021'; + // 使用相对路径,自动适应当前域名 + const API_BASE = window.location.origin; const res = await fetch(`${API_BASE}/api/config`); backendConfig = await res.json();