From 0607e6241bed1c94cfcdb1e3e6ef98b07a02e020 Mon Sep 17 00:00:00 2001 From: UnknownMp Date: Wed, 14 May 2025 18:00:56 +0800 Subject: [PATCH] =?UTF-8?q?[BugFix]=20=E4=BF=AE=E5=A4=8D=E9=93=BE=E6=8E=A5?= =?UTF-8?q?=E8=BD=AC=E6=8D=A2=E5=99=A8=E4=B8=8D=E6=98=BE=E7=A4=BA=E6=A0=BC?= =?UTF-8?q?=E5=BC=8F=E9=94=99=E8=AF=AF=E7=9A=84=20BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/Root.vue | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/views/Root.vue b/src/views/Root.vue index 43dda41..6d54ba3 100644 --- a/src/views/Root.vue +++ b/src/views/Root.vue @@ -10,10 +10,12 @@ import Intro from '../texts/intro.md' const router = useRouter() const err = ref(false) +const srcText = ref(null) function convert(from) { if( Number(from) ) { return { + type: 's', id: Number(from) } } else if (from.includes('https://archiveofourown.org/works/')) { @@ -34,9 +36,11 @@ function convert(from) { } function onConvert(data) { - const { id, cid } = convert(data.src) - if (id == null) { + const { type, id, cid } = convert(data.src) + console.log(type, id, cid) + if (type == null) { err.value = true + srcText.value?.focus() } else { err.value = false if (cid) router.push(`/work/${id}/${cid}`) @@ -54,7 +58,7 @@ function onConvert(data) {

链接转换

输入完整链接或者 ID

- + 链接格式错误!