From c7052731761c8bab8b07d96bdbbd7d195862add4 Mon Sep 17 00:00:00 2001 From: "tangly1024.com" Date: Sun, 29 Sep 2024 17:58:03 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=86=E4=BA=AB=E9=93=BE=E6=8E=A5url?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/ShareButtons.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/components/ShareButtons.js b/components/ShareButtons.js index 853aa3a4..616c39c1 100644 --- a/components/ShareButtons.js +++ b/components/ShareButtons.js @@ -70,8 +70,10 @@ const ShareButtons = ({ post }) => { const [qrCodeShow, setQrCodeShow] = useState(false) const copyUrl = () => { - navigator?.clipboard?.writeText(shareUrl) - alert(locale.COMMON.URL_COPIED + ' \n' + shareUrl) + // 确保 shareUrl 是一个正确的字符串并进行解码 + const decodedUrl = decodeURIComponent(shareUrl) + navigator?.clipboard?.writeText(decodedUrl) + alert(locale.COMMON.URL_COPIED + ' \n' + decodedUrl) } const openPopover = () => {