From a1e4246bf4f1070e796118e41ef0c67a6d09da17 Mon Sep 17 00:00:00 2001 From: wonder Date: Fri, 26 Jun 2026 16:26:10 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=9C=A8=E8=AE=BE=E7=BD=AE=E9=A1=B5?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E7=B3=BB=E7=BB=9F=E6=A0=87=E7=AD=BE=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E9=9D=A2=E6=9D=BF=EF=BC=8C=E6=94=BE=E5=BC=80=E7=B3=BB?= =?UTF-8?q?=E7=BB=9F=E6=A0=87=E7=AD=BE=E7=9A=84=20CRUD=20=E9=99=90?= =?UTF-8?q?=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 移除 tags.go 中 UpdateTag 和 DeleteTag 对系统标签的 403 限制 - 在 settings.html 新增「系统标签管理」卡片,支持: - 折叠浏览所有系统标签及其选项 - 编辑标签名称和描述 - 编辑、添加、删除标签选项 - 删除整个标签(带二次确认) - .gitignore 添加 prompt-generator 二进制文件 --- .gitignore | 1 + frontend/settings.html | 119 ++++++++++++++++++++++++++++++++++++++ internal/handlers/tags.go | 15 ----- 3 files changed, 120 insertions(+), 15 deletions(-) diff --git a/.gitignore b/.gitignore index 50c3d9a..9943d1b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ .env *.exe server +prompt-generator diff --git a/frontend/settings.html b/frontend/settings.html index 192e5e6..86adbd8 100644 --- a/frontend/settings.html +++ b/frontend/settings.html @@ -49,6 +49,14 @@ + +
+
🏷️ 系统标签管理
+
+
加载中...
+
+
+
🔐 账号
@@ -60,6 +68,11 @@ diff --git a/internal/handlers/tags.go b/internal/handlers/tags.go index b477026..5701cab 100644 --- a/internal/handlers/tags.go +++ b/internal/handlers/tags.go @@ -70,14 +70,6 @@ func UpdateTag(w http.ResponseWriter, r *http.Request) { return } - // Check ownership - var scope string - db.DB.QueryRow("SELECT scope FROM tags WHERE id=?", id).Scan(&scope) - if scope != "personal" { - fail(w, 403, "不能修改系统标签") - return - } - var req struct { Name string `json:"name"` Description string `json:"description"` @@ -102,13 +94,6 @@ func DeleteTag(w http.ResponseWriter, r *http.Request) { return } - var scope string - db.DB.QueryRow("SELECT scope FROM tags WHERE id=?", id).Scan(&scope) - if scope != "personal" { - fail(w, 403, "不能删除系统标签") - return - } - // Delete options first db.DB.Exec("DELETE FROM tag_options WHERE tag_id=?", id) db.DB.Exec("DELETE FROM tags WHERE id=?", id)