From c52223bb0f8e1ebbd85c73dc8b6878b5e447b179 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E9=94=A6=E5=BC=BA?= <1061669148@qq.com> Date: Sun, 9 Mar 2025 17:32:45 +0800 Subject: [PATCH] feat: update copy link functionality to include full URL --- web/static/js/app.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/web/static/js/app.js b/web/static/js/app.js index 835ba7b..4eac344 100644 --- a/web/static/js/app.js +++ b/web/static/js/app.js @@ -149,13 +149,15 @@ document.addEventListener('DOMContentLoaded', function() { // 复制链接按钮点击事件 copyLinkButton.addEventListener('click', function() { if (lastAudioUrl) { - navigator.clipboard.writeText(lastAudioUrl).then(() => { + // 获取完整的URL,包括域名部分 + const fullUrl = new URL(lastAudioUrl, window.location.origin).href; + navigator.clipboard.writeText(fullUrl).then(() => { alert('链接已复制到剪贴板'); }).catch(err => { console.error('复制失败:', err); // 兼容处理 const textArea = document.createElement('textarea'); - textArea.value = lastAudioUrl; + textArea.value = fullUrl; document.body.appendChild(textArea); textArea.focus(); textArea.select();