From 23bd84ac4c97e9c621c90f528fb80f6bfc29e52c Mon Sep 17 00:00:00 2001 From: Nixevol Date: Wed, 18 Nov 2026 10:28:54 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=8E=BB=E6=8E=89=E8=AF=B4=E6=98=8E?= =?UTF-8?q?=E9=A1=B5=E9=87=8C=E5=AF=B9=E5=B1=95=E7=A4=BA=E7=8E=AF=E5=A2=83?= =?UTF-8?q?=E7=9A=84=E6=8F=8F=E8=BF=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/features/notice/NoticeView.vue | 29 +++++++++++++++----------- web/src/styles.css | 5 +++++ 2 files changed, 22 insertions(+), 12 deletions(-) diff --git a/web/src/features/notice/NoticeView.vue b/web/src/features/notice/NoticeView.vue index cc900de..673696f 100644 --- a/web/src/features/notice/NoticeView.vue +++ b/web/src/features/notice/NoticeView.vue @@ -3,27 +3,31 @@ import { ref } from "vue"; import { NButton } from "naive-ui"; const toolUrl = "https://euniv.asio.asia"; +const urlEl = ref(null); const copied = ref(false); +const copyFailed = ref(false); let copiedTimer = 0; async function copyUrl() { + copied.value = false; + copyFailed.value = false; try { await navigator.clipboard.writeText(toolUrl); + copied.value = true; } catch { - const box = document.createElement("textarea"); - box.value = toolUrl; - box.setAttribute("readonly", ""); - box.style.position = "fixed"; - box.style.left = "-9999px"; - document.body.appendChild(box); - box.select(); - document.execCommand("copy"); - box.remove(); + copyFailed.value = true; + const node = urlEl.value; + if (!node) return; + const range = document.createRange(); + range.selectNodeContents(node); + const selection = window.getSelection(); + selection?.removeAllRanges(); + selection?.addRange(range); } - copied.value = true; window.clearTimeout(copiedTimer); copiedTimer = window.setTimeout(() => { copied.value = false; + copyFailed.value = false; }, 2000); } @@ -38,13 +42,14 @@ function openTool() {

旧版工具已失效

因目标平台升级,旧版工具已失效,无法登录使用。新版工具已上线。

-

这个页面可能显示在其他程序里。请先复制下面的地址,打开浏览器,粘贴到地址栏后访问。

-

{{ toolUrl }}

+

请复制下面的地址,打开浏览器,粘贴到地址栏后访问。

+

{{ toolUrl }}

{{ copied ? "已复制" : "复制地址" }} 尝试打开

已复制。请到浏览器地址栏粘贴后访问。

+

没有复制成功,地址已选中,请手动使用CTRL+C复制。

diff --git a/web/src/styles.css b/web/src/styles.css index 809a7e2..a5f4a5b 100644 --- a/web/src/styles.css +++ b/web/src/styles.css @@ -1704,6 +1704,11 @@ select { color: var(--ok); } +.notice-missed { + margin: 12px 0 0; + color: var(--warn); +} + .app-root { position: relative; }