From bb7292873878b6f787c0716912628097aaddae0f Mon Sep 17 00:00:00 2001 From: anian Date: Mon, 9 Mar 2026 22:13:36 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=AF=B9=E8=A7=86=E9=A2=91?= =?UTF-8?q?=E7=9A=84=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 13 +++++- build.gradle | 2 +- console/src/components/LazyImage.vue | 68 +++++++++++++++++++++++----- console/src/views/PhotoList.vue | 42 +++++++++-------- gradle.properties | 2 +- src/main/resources/plugin.yaml | 1 - 6 files changed, 93 insertions(+), 35 deletions(-) diff --git a/README.md b/README.md index 810bd2f..1a6f99d 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,14 @@ +# anian-plugin-photos + +> 基于原作者v1.5.1代码修改 + +#### v1.5.1-1 +1. 新增对视频的支持 + + + + + # plugin-photos Halo 2.0 的相册管理插件, 支持在 Console 进行管理以及为主题端提供 `/photos` 页面路由。 @@ -352,4 +363,4 @@ List<[#PhotoVo](#photovo)> | 对应模型 | group | kind | | ---------- | ---------------- | ---------- | | 图库 | core.halo.run | Photo | -| 图库分组 | core.halo.run | PhotoGroup | \ No newline at end of file +| 图库分组 | core.halo.run | PhotoGroup | diff --git a/build.gradle b/build.gradle index aa88ec6..2a4e69e 100644 --- a/build.gradle +++ b/build.gradle @@ -18,7 +18,7 @@ repositories { } dependencies { - implementation platform('run.halo.tools.platform:plugin:2.17.0-SNAPSHOT') + implementation platform('run.halo.tools.platform:plugin:2.20.11') compileOnly 'run.halo.app:api' testImplementation 'run.halo.app:api' diff --git a/console/src/components/LazyImage.vue b/console/src/components/LazyImage.vue index 91e3645..98721d3 100644 --- a/console/src/components/LazyImage.vue +++ b/console/src/components/LazyImage.vue @@ -1,5 +1,5 @@ + + \ No newline at end of file diff --git a/console/src/views/PhotoList.vue b/console/src/views/PhotoList.vue index f2a58ad..f83e49b 100644 --- a/console/src/views/PhotoList.vue +++ b/console/src/views/PhotoList.vue @@ -240,26 +240,28 @@ const onAttachmentsSelect = async (attachments: AttachmentLike[]) => { type?: string; }[]; - for (const photo of photos) { - const type = photo.type; - if (!type) { - Toast.error("只支持选择图片"); - nextTick(() => { - attachmentModal.value = true; - }); +for (const photo of photos) { + const type = photo.type; - return; - } - const fileType = type.split("/")[0]; - if (fileType !== "image") { - Toast.error("只支持选择图片"); - nextTick(() => { - attachmentModal.value = true; - }); - return; - } + if (!type) { + Toast.error("只支持选择图片或视频"); + nextTick(() => { + attachmentModal.value = true; + }); + return; } + const fileType = type.split("/")[0]; + + if (fileType !== "image" && fileType !== "video") { + Toast.error("只支持选择图片或视频"); + nextTick(() => { + attachmentModal.value = true; + }); + return; + } +} + const createRequests = photos.map((photo) => { return axiosInstance.post("/apis/core.halo.run/v1alpha1/photos", { metadata: { @@ -310,7 +312,7 @@ const onEditingModalClose = () => { - + + \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index 8d0c7be..39f80c5 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1 +1 @@ -version=1.0.0-SNAPSHOT +version=1.5.1-1 diff --git a/src/main/resources/plugin.yaml b/src/main/resources/plugin.yaml index 2e556cf..18fa534 100644 --- a/src/main/resources/plugin.yaml +++ b/src/main/resources/plugin.yaml @@ -8,7 +8,6 @@ metadata: "store.halo.run/app-id": "app-BmQJW" spec: enabled: true - version: 1.0.0 requires: ">=2.21.0" author: name: Halo