fix: API地址改为相对路径,适应不同设备访问

This commit is contained in:
2026-04-27 15:41:46 +08:00
parent 6ab58cb363
commit d1ddd340c0

View File

@@ -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();