diff --git a/src/views/dialogue/components/TitleBar.vue b/src/views/dialogue/components/TitleBar.vue index fe93b68b5b467ec13c0096fe1ba8cb785aeeaa35..4ce5d02546ae98419d8ee33a91826d52f9dd5a96 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 d971c0052526a1be5cdb5cb778f80ba57a3bebdb..b968bf51c4abef644a98f18c3eca06ebd7630a82 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 4c593ebf3e90641a220b46673d72a629b296f3cd..7f5fe2c874f3229730e3f617a165d68f299b47c3 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) => {