From 8c43f5fa734828fe2d76099c1ce8d3e6f1f7e2df Mon Sep 17 00:00:00 2001 From: tone Date: Sat, 27 Dec 2025 13:19:17 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E7=BC=96=E8=BE=91=E5=8D=9A=E5=AE=A2?= =?UTF-8?q?=E6=94=AF=E6=8C=81Slug=E5=AD=97=E6=AE=B5=EF=BC=8C=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E5=A4=8D=E5=88=B6=E9=93=BE=E6=8E=A5=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/admin/dto/admin-web/update-blog.dto.ts | 3 +++ .../web/blog/components/BlogEdit.tsx | 18 ++++++++++++++++++ .../frontend/lib/api/endpoints/admin.client.ts | 17 ++++++++++++++++- apps/frontend/lib/types/blog.ts | 1 + 4 files changed, 38 insertions(+), 1 deletion(-) diff --git a/apps/backend/src/admin/dto/admin-web/update-blog.dto.ts b/apps/backend/src/admin/dto/admin-web/update-blog.dto.ts index 29d9eca..8c79caa 100644 --- a/apps/backend/src/admin/dto/admin-web/update-blog.dto.ts +++ b/apps/backend/src/admin/dto/admin-web/update-blog.dto.ts @@ -8,6 +8,9 @@ export class UpdateBlogDto { @IsString() description: string; + @IsString() + slug: string; + @IsString() contentUrl: string; diff --git a/apps/frontend/app/console/(with-menu)/web/blog/components/BlogEdit.tsx b/apps/frontend/app/console/(with-menu)/web/blog/components/BlogEdit.tsx index e7aabe6..1eb5121 100644 --- a/apps/frontend/app/console/(with-menu)/web/blog/components/BlogEdit.tsx +++ b/apps/frontend/app/console/(with-menu)/web/blog/components/BlogEdit.tsx @@ -20,6 +20,7 @@ import { BlogPermissionCheckBoxs } from "./BlogPermissionCheckBoxs" import { BlogPermission } from "@/lib/types/Blog.Permission.enum" import { SetPasswordDialog } from "./SetPasswordDialog" import { AdminAPI } from "@/lib/api/client" +import { copyShareURL } from "./utils" interface BlogEditProps { id: string; @@ -46,6 +47,7 @@ export default function BlogEdit({ id, children, onRefresh }: BlogEditProps) { await AdminAPI.updateBlog(id, { title: blog.title, description: blog.description, + slug: blog.slug, contentUrl: blog.contentUrl, permissions: blog.permissions, }); @@ -106,6 +108,17 @@ export default function BlogEdit({ id, children, onRefresh }: BlogEditProps) { onChange={(e) => mutate({ ...blog, description: e.target.value }, false)} /> +
+ + mutate({ ...blog, slug: e.target.value }, false)} + /> +