From d6ccbb06f9b7523fa26ac2564b31cfdf720c3b67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8F=B2=E9=B8=BF=E5=AE=87?= Date: Tue, 20 May 2025 16:42:48 +0800 Subject: [PATCH 1/3] =?UTF-8?q?refactor:=20=E7=AE=80=E5=8C=96iframe?= =?UTF-8?q?=E7=9B=AE=E6=A0=87URL=E7=9A=84=E8=AE=BE=E7=BD=AE=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 史鸿宇 --- src/views/dialogue/components/TitleBar.vue | 10 ++++------ src/views/dialogue/dialogueView.vue | 13 ++++--------- src/views/tools/index.vue | 8 ++------ 3 files changed, 10 insertions(+), 21 deletions(-) diff --git a/src/views/dialogue/components/TitleBar.vue b/src/views/dialogue/components/TitleBar.vue index 742086a..d3d5516 100644 --- a/src/views/dialogue/components/TitleBar.vue +++ b/src/views/dialogue/components/TitleBar.vue @@ -23,14 +23,12 @@ onMounted(async () => { const baseUrl = await getBaseUrl(); const origin = window.location.origin; const isElectron = window.navigator.userAgent.includes('Electron'); - const isLocalhost = - window.location.hostname === 'localhost' || - window.location.hostname === '127.0.0.1'; - iframeTarget.value = - isElectron || isLocalhost ? `${baseUrl}/witchaind` : `${origin}/witchaind`; + iframeTarget.value = isElectron + ? `${baseUrl}/witchaind` + : `${origin}/witchaind`; }); -const changeLanguagefun = (lang: "zh_cn" | "en") => { +const changeLanguagefun = (lang: 'zh_cn' | 'en') => { changeLanguage(lang); // 同步语言到iframe const iframe = document.querySelector('#my-iframe'); diff --git a/src/views/dialogue/dialogueView.vue b/src/views/dialogue/dialogueView.vue index 15f4a98..971deb7 100644 --- a/src/views/dialogue/dialogueView.vue +++ b/src/views/dialogue/dialogueView.vue @@ -1,5 +1,5 @@