From 86160e0ecbc92d473276e8b1c0bbf27a5dbdb865 Mon Sep 17 00:00:00 2001 From: zxstty Date: Tue, 10 Jun 2025 22:41:14 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Diframe=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/dialogue/components/TitleBar.vue | 7 +++---- src/views/dialogue/dialogueView.vue | 2 +- src/views/tools/index.vue | 5 ++--- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/views/dialogue/components/TitleBar.vue b/src/views/dialogue/components/TitleBar.vue index fe93b68b..4ce5d025 100644 --- a/src/views/dialogue/components/TitleBar.vue +++ b/src/views/dialogue/components/TitleBar.vue @@ -23,10 +23,9 @@ onMounted(async () => { const baseUrl = await getBaseUrl(); const origin = window.location.origin; const isElectron = window.navigator.userAgent.includes('Electron'); - iframeTarget.value = 'http://localhost:3002/witchaind/' - // isElectron - // ? `${baseUrl}/witchaind` - // : `${origin}/witchaind`; + iframeTarget.value = isElectron + ? `${baseUrl}/witchaind` + : `${origin}/witchaind`; }); const changeLanguagefun = (lang: 'zh_cn' | 'en') => { diff --git a/src/views/dialogue/dialogueView.vue b/src/views/dialogue/dialogueView.vue index d971c005..b968bf51 100644 --- a/src/views/dialogue/dialogueView.vue +++ b/src/views/dialogue/dialogueView.vue @@ -188,7 +188,7 @@ onMounted(async () => { const iframe = document.getElementById('my-iframe') as HTMLIFrameElement; if (iframe) { - iframe.src = 'http://localhost:3002/witchaind/'; + iframe.src = iframeTarget; } }); diff --git a/src/views/tools/index.vue b/src/views/tools/index.vue index 4c593ebf..7f5fe2c8 100644 --- a/src/views/tools/index.vue +++ b/src/views/tools/index.vue @@ -8,7 +8,7 @@ sandbox="allow-scripts allow-popups allow-same-origin allow-downloads" height="100%" width="100%" - src="http://localhost:3002/witchaind/" + :src="iframeTarget" @load="handleIframeLoad" @error="handleIframeError" > @@ -103,8 +103,7 @@ watch( // 添加错误处理 onMounted(async () => { - // iframeTarget.value = await getIframeTarget(); - iframeTarget.value = 'http://localhost:3002/witchaind/'; + iframeTarget.value = await getIframeTarget(); const iframe = iframeRef.value; if (iframe) { iframe.onerror = (error) => { -- Gitee