From d96c4c9adfda4ac8967d9894b68644aa3433488a Mon Sep 17 00:00:00 2001 From: tone <3341154833@qq.com> Date: Mon, 23 Jun 2025 01:29:02 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E6=88=90=E9=93=BE=E6=8E=A5=E5=A4=8D?= =?UTF-8?q?=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../web/blog/components/AddBlog.tsx | 5 +++- .../web/blog/components/BlogEdit.tsx | 6 ++++- .../web/blog/components/SetPasswordDialog.tsx | 27 +++++++++++++++---- 3 files changed, 31 insertions(+), 7 deletions(-) diff --git a/tone-page-web/app/console/(with-menu)/web/blog/components/AddBlog.tsx b/tone-page-web/app/console/(with-menu)/web/blog/components/AddBlog.tsx index 438a9a6..563820b 100644 --- a/tone-page-web/app/console/(with-menu)/web/blog/components/AddBlog.tsx +++ b/tone-page-web/app/console/(with-menu)/web/blog/components/AddBlog.tsx @@ -1,10 +1,10 @@ 'use client' import { Button } from "@/components/ui/button"; -import { Checkbox } from "@/components/ui/checkbox"; import { Dialog, DialogContent, + DialogDescription, DialogFooter, DialogHeader, DialogTitle, @@ -65,6 +65,9 @@ export default function AddBlog({ children, onRefresh }: AddBlogProps) { 添加博客 + + 保存前请确认博客信息填写正确、权限配置合理 +
diff --git a/tone-page-web/app/console/(with-menu)/web/blog/components/BlogEdit.tsx b/tone-page-web/app/console/(with-menu)/web/blog/components/BlogEdit.tsx index 9768648..e1ceef9 100644 --- a/tone-page-web/app/console/(with-menu)/web/blog/components/BlogEdit.tsx +++ b/tone-page-web/app/console/(with-menu)/web/blog/components/BlogEdit.tsx @@ -4,6 +4,7 @@ import React, { useState } from "react" import { Dialog, DialogContent, + DialogDescription, DialogFooter, DialogHeader, DialogTitle, @@ -74,7 +75,10 @@ export default function BlogEdit({ id, children, onRefresh }: BlogEditProps) { - 添加博客 + 编辑博客 + + 保存前请确认博客信息填写正确、权限配置合理 + { blog && ( diff --git a/tone-page-web/app/console/(with-menu)/web/blog/components/SetPasswordDialog.tsx b/tone-page-web/app/console/(with-menu)/web/blog/components/SetPasswordDialog.tsx index 5e400a9..e12d101 100644 --- a/tone-page-web/app/console/(with-menu)/web/blog/components/SetPasswordDialog.tsx +++ b/tone-page-web/app/console/(with-menu)/web/blog/components/SetPasswordDialog.tsx @@ -14,6 +14,7 @@ import { import { Input } from "@/components/ui/input" import { Label } from "@/components/ui/label" import { AdminApi } from "@/lib/api"; +import { base62 } from "@/lib/utils"; import React, { useEffect, useState } from "react"; import { toast } from "sonner"; @@ -45,6 +46,15 @@ export function SetPasswordDialog({ id, children }: SetPasswordDialogProps) { } }, [open]) + const handleCopyShareURL = () => { + if (!password) { + return toast.warning('请先填写新密码'); + } + const url = `${window.location.origin}/blog/${base62.encode(Buffer.from(id.replace(/-/g, ''), 'hex'))}?p=${password}`; + navigator.clipboard.writeText(url); + toast.success('分享链接复制成功,请点击保存按钮以提交新密码'); + } + return ( setOpen(v)}>
@@ -55,7 +65,7 @@ export function SetPasswordDialog({ id, children }: SetPasswordDialogProps) { 修改密码 - 通过密码访问受保护的文章,需开启“受密码保护”权限 + 通过密码访问受保护的文章,需开启“受密码保护”权限。注意复制URL需要填写完新密码后再点击
@@ -70,10 +80,17 @@ export function SetPasswordDialog({ id, children }: SetPasswordDialogProps) {
- - - - +
+
+ +
+
+ + + + +
+