From 09f9800f2a2fdfc0d2694f83391b4c61f5f0ffb3 Mon Sep 17 00:00:00 2001 From: anghunk Date: Wed, 21 Jan 2026 21:25:18 +0800 Subject: [PATCH] =?UTF-8?q?fix(CommentsView):=20=E7=A7=BB=E9=99=A4?= =?UTF-8?q?=E5=9B=BA=E5=AE=9A=E9=AB=98=E5=BA=A6=E5=B9=B6=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E6=BB=9A=E5=8A=A8=E6=9D=A1=E4=BB=A5=E6=94=B9=E5=96=84=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E4=BD=93=E9=AA=8C=20refactor(listComments):=20?= =?UTF-8?q?=E7=AE=80=E5=8C=96=E8=AF=84=E8=AE=BA=E6=8E=92=E5=BA=8F=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 移除CommentsView中的固定高度限制并添加overflow-y属性,使内容可滚动 修改listComments的SQL查询,去除priority排序以简化逻辑 --- cwd-admin/src/views/CommentsView.vue | 2 +- cwd-api/src/api/admin/listComments.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cwd-admin/src/views/CommentsView.vue b/cwd-admin/src/views/CommentsView.vue index 084114e..dce9ba1 100644 --- a/cwd-admin/src/views/CommentsView.vue +++ b/cwd-admin/src/views/CommentsView.vue @@ -921,13 +921,13 @@ onMounted(() => { box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2); width: 100%; max-width: 600px; - height: 100vh; padding: 20px 20px 24px; display: flex; flex-direction: column; gap: 16px; transform: translateX(0); animation: drawer-in 0.2s ease-out; + overflow-y: auto; } .modal-title { diff --git a/cwd-api/src/api/admin/listComments.ts b/cwd-api/src/api/admin/listComments.ts index ae30dfd..ff0c566 100644 --- a/cwd-api/src/api/admin/listComments.ts +++ b/cwd-api/src/api/admin/listComments.ts @@ -27,7 +27,7 @@ export const listComments = async (c: Context<{ Bindings: Bindings }>) => { .first<{ count: number }>(); const { results } = await c.env.CWD_DB.prepare( - `SELECT * FROM Comment ${whereSql} ORDER BY priority DESC, created DESC LIMIT ? OFFSET ?` + `SELECT * FROM Comment ${whereSql} ORDER BY created DESC LIMIT ? OFFSET ?` ) .bind(...params, limit, offset) .all();