From 807772b3e442741d7f7b2f5995c8200b56606b10 Mon Sep 17 00:00:00 2001 From: hubian <908234780@qq.com> Date: Mon, 13 Apr 2026 11:55:40 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E7=BC=96=E8=BE=91=E5=A4=87=E6=B3=A8?= =?UTF-8?q?=E6=94=B9=E4=B8=BA=E5=A4=9A=E8=A1=8C=E8=BE=93=E5=85=A5=E6=A1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- xian_favor/api.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/xian_favor/api.py b/xian_favor/api.py index 05c72aa..fb11418 100644 --- a/xian_favor/api.py +++ b/xian_favor/api.py @@ -449,7 +449,7 @@ INDEX_TEMPLATE = '''
- +
@@ -721,7 +721,11 @@ async function openEditModal(id) { // 保存编辑 async function saveEdit() { const id = document.getElementById('editId').value; - const type = currentDetailId ? (await fetch(`${API_BASE}/items/${currentDetailId}`).then(r => r.json())).data.type : 'text'; + + // 获取当前条目的类型 + const detailRes = await fetch(`${API_BASE}/items/${currentDetailId}`); + const detailData = await detailRes.json(); + const type = detailData.data.type; const data = { title: document.getElementById('editTitle').value,