From 5374add5d875b8a30d9aa5e36aeb1ca5a73823c9 Mon Sep 17 00:00:00 2001 From: fawney19 Date: Tue, 13 Jan 2026 20:29:16 +0800 Subject: [PATCH] =?UTF-8?q?feat(update):=20=E5=A2=9E=E5=BC=BA=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E6=A3=80=E6=9F=A5=E5=8A=9F=E8=83=BD=EF=BC=8C=E5=B1=95?= =?UTF-8?q?=E7=A4=BA=E5=8F=91=E5=B8=83=E6=97=A5=E5=BF=97=E5=92=8C=E5=8F=91?= =?UTF-8?q?=E5=B8=83=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 后端从 GitHub Tags API 改为 Releases API,获取更丰富的发布信息 - 新增 release_notes 和 published_at 字段 - 前端更新对话框展示发布时间和 Markdown 格式的更新日志 - 使用 DOMPurify 对 Markdown 渲染结果进行 XSS 防护 - 简化 GlobalModel 缓存失效逻辑,合并同步/异步调用 --- frontend/src/api/admin.ts | 2 + .../src/components/common/UpdateDialog.vue | 68 +++++++++++++- frontend/src/layouts/MainLayout.vue | 2 + src/api/admin/models/global_models.py | 11 +-- src/api/admin/system.py | 90 +++++++++---------- 5 files changed, 110 insertions(+), 63 deletions(-) diff --git a/frontend/src/api/admin.ts b/frontend/src/api/admin.ts index 06014fb..7a6c2e2 100644 --- a/frontend/src/api/admin.ts +++ b/frontend/src/api/admin.ts @@ -166,6 +166,8 @@ export interface CheckUpdateResponse { latest_version: string | null has_update: boolean release_url: string | null + release_notes: string | null + published_at: string | null error: string | null } diff --git a/frontend/src/components/common/UpdateDialog.vue b/frontend/src/components/common/UpdateDialog.vue index 75f7b7d..8e75670 100644 --- a/frontend/src/components/common/UpdateDialog.vue +++ b/frontend/src/components/common/UpdateDialog.vue @@ -17,7 +17,7 @@ -
+
v{{ currentVersion }} @@ -39,8 +39,33 @@
- -

+ +

+ 发布于 {{ formattedPublishedAt }} +

+ + +
+
+ 更新内容 +
+
+
+ + +

新版本已发布,建议更新以获得最新功能和安全修复

@@ -66,16 +91,20 @@