fix: 去掉说明页里对展示环境的描述

This commit is contained in:
Nixevol
2026-11-18 10:28:54 +08:00
parent 730c539579
commit 23bd84ac4c
2 changed files with 22 additions and 12 deletions
+17 -12
View File
@@ -3,27 +3,31 @@ import { ref } from "vue";
import { NButton } from "naive-ui"; import { NButton } from "naive-ui";
const toolUrl = "https://euniv.asio.asia"; const toolUrl = "https://euniv.asio.asia";
const urlEl = ref<HTMLElement | null>(null);
const copied = ref(false); const copied = ref(false);
const copyFailed = ref(false);
let copiedTimer = 0; let copiedTimer = 0;
async function copyUrl() { async function copyUrl() {
copied.value = false;
copyFailed.value = false;
try { try {
await navigator.clipboard.writeText(toolUrl); await navigator.clipboard.writeText(toolUrl);
copied.value = true;
} catch { } catch {
const box = document.createElement("textarea"); copyFailed.value = true;
box.value = toolUrl; const node = urlEl.value;
box.setAttribute("readonly", ""); if (!node) return;
box.style.position = "fixed"; const range = document.createRange();
box.style.left = "-9999px"; range.selectNodeContents(node);
document.body.appendChild(box); const selection = window.getSelection();
box.select(); selection?.removeAllRanges();
document.execCommand("copy"); selection?.addRange(range);
box.remove();
} }
copied.value = true;
window.clearTimeout(copiedTimer); window.clearTimeout(copiedTimer);
copiedTimer = window.setTimeout(() => { copiedTimer = window.setTimeout(() => {
copied.value = false; copied.value = false;
copyFailed.value = false;
}, 2000); }, 2000);
} }
@@ -38,13 +42,14 @@ function openTool() {
<section class="notice-card"> <section class="notice-card">
<h1>旧版工具已失效</h1> <h1>旧版工具已失效</h1>
<p>因目标平台升级,旧版工具已失效,无法登录使用。新版工具已上线。</p> <p>因目标平台升级,旧版工具已失效,无法登录使用。新版工具已上线。</p>
<p>这个页面可能显示在其他程序里。请先复制下面的地址,打开浏览器,粘贴到地址栏后访问。</p> <p>请复制下面的地址,打开浏览器,粘贴到地址栏后访问。</p>
<p class="notice-url">{{ toolUrl }}</p> <p ref="urlEl" class="notice-url">{{ toolUrl }}</p>
<div class="notice-actions"> <div class="notice-actions">
<n-button type="primary" @click="copyUrl">{{ copied ? "已复制" : "复制地址" }}</n-button> <n-button type="primary" @click="copyUrl">{{ copied ? "已复制" : "复制地址" }}</n-button>
<n-button @click="openTool">尝试打开</n-button> <n-button @click="openTool">尝试打开</n-button>
</div> </div>
<p v-if="copied" class="notice-done">已复制。请到浏览器地址栏粘贴后访问。</p> <p v-if="copied" class="notice-done">已复制。请到浏览器地址栏粘贴后访问。</p>
<p v-else-if="copyFailed" class="notice-missed">没有复制成功,地址已选中,请手动使用CTRL+C复制。</p>
</section> </section>
</main> </main>
</template> </template>
+5
View File
@@ -1704,6 +1704,11 @@ select {
color: var(--ok); color: var(--ok);
} }
.notice-missed {
margin: 12px 0 0;
color: var(--warn);
}
.app-root { .app-root {
position: relative; position: relative;
} }