desktop修正

This commit is contained in:
admin
2025-12-14 23:54:48 +09:00
parent f9f5eec35e
commit 74dcb88fe6
25 changed files with 1068 additions and 157 deletions

View File

@@ -1,10 +1,13 @@
const API_BASE = "http://localhost:18080";
const API_BASE = "http://127.0.0.1:18080";
async function apiGet(path) {
const res = await fetch(`${API_BASE}${path}`);
async function apiGet(path, params = {}) {
const query = new URLSearchParams(params).toString();
const url = `${API_BASE}${path}?${query}`;
const res = await fetch(url);
if (!res.ok) {
const text = await res.text();
throw new Error(text || "APIエラー");
const data = await res.json();
throw new Error(data.detail || "APIエラー");
}
return res.json();
}