diff --git a/src/views/dialogue/dialogueView.vue b/src/views/dialogue/dialogueView.vue index f8845693e4f1dc19a1125258cfae28c238bd109d..b5722ae92acd0bc1bdcb245e257304bbbf27c84f 100644 --- a/src/views/dialogue/dialogueView.vue +++ b/src/views/dialogue/dialogueView.vue @@ -229,6 +229,14 @@ onMounted(() => { } console.log('onMounted', window.location.host); initCopilot(); + const iframe = document.getElementById('my-iframe') as HTMLIFrameElement; + if (iframe) { + if(window.location.origin === 'http://localhost:3000'){ + iframe.src = `http://localhost:3002`; + }else{ + iframe.src = `${window.location.origin}/witchaind`; + } + } }); watch( @@ -286,14 +294,6 @@ watch( name: String(currRoute.value.query.name), }; } - - // 监听路由变化给iframe.src赋值 - if (currRoute.value.path === '/witchainD') { - const iframe = document.getElementById('my-iframe') as HTMLIFrameElement; - if(iframe){ - iframe.src = `${window.location.origin}/witchaind`; - } - } }, { deep: true, immediate: true }, ); @@ -428,8 +428,7 @@ watch( > - - +