From: root Date: Mon, 14 Sep 2026 06:44:42 +0000 (+0800) Subject: 后端sites增加app_name/app_icon/app_icon_filename字段支持 X-Git-Url: http://acesimba.cloud/gitweb/?a=commitdiff_plain;h=ce83e5a71dc86f74b4aacf3f3e47e45735fc17b3;p=StationBuilder.git 后端sites增加app_name/app_icon/app_icon_filename字段支持 --- diff --git a/db-sidecar.mjs b/db-sidecar.mjs index f8732e2..8ae8bff 100644 --- a/db-sidecar.mjs +++ b/db-sidecar.mjs @@ -386,6 +386,9 @@ function ensureColumn(table, column, def) { ensureColumn("cubes", "prompt", "TEXT"); ensureColumn("sites", "style_id", "INTEGER"); ensureColumn("sites", "parent_id", "INTEGER"); +ensureColumn("sites", "app_name", "TEXT"); +ensureColumn("sites", "app_icon", "TEXT"); +ensureColumn("sites", "app_icon_filename", "TEXT"); ensureColumn("domain_templates", "supplement", "TEXT"); ensureColumn("domain_templates", "style_id", "INTEGER"); ensureColumn("domain_pages", "status", "TEXT DEFAULT 'pending'"); @@ -2648,10 +2651,12 @@ async function route(req, res) { } if (req.method === "PUT") { const body = await parseBody(req); - db.prepare("UPDATE sites SET name=?, domain=?, description=?, supplement=?, style_id=?, parent_id=?, updated_at=CURRENT_TIMESTAMP WHERE id=?").run( + db.prepare("UPDATE sites SET name=?, domain=?, description=?, supplement=?, style_id=?, parent_id=?, app_name=?, app_icon=?, app_icon_filename=?, updated_at=CURRENT_TIMESTAMP WHERE id=?").run( body.name ?? "", body.domain ?? "", body.description ?? "", body.supplement ?? "", body.style_id != null ? Number(body.style_id) : null, - body.parent_id != null ? Number(body.parent_id) : null, siteId + body.parent_id != null ? Number(body.parent_id) : null, + body.app_name ?? null, body.app_icon ?? null, body.app_icon_filename ?? null, + siteId ); return respondJson(res, 200, hydrateSite(siteId)); }