diff --git a/src/App.vue b/src/App.vue
index 575a47f35f46c900e7a42c51d84c635ad5ee1e51..46439d73c66da38b75e8c2b033614a79667d42d3 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -3,31 +3,6 @@ import { qiankunWindow } from 'vite-plugin-qiankun/dist/helper';
import '@vue-flow/core/dist/style.css';
import '@vue-flow/core/dist/theme-default.css';
import DialogueView from 'src/views/dialogue/dialogueView.vue';
-import { watch } from 'vue';
-import { useRouter } from 'vue-router';
-const router = useRouter();
-
-// 监听路由变化,控制iframe内容的活动状态
-watch(
- () => router.currentRoute.value.path,
- (newPath) => {
- const iframe = document.getElementById('my-iframe');
- const isWitchaindRoute = newPath === '/witchainD';
- if (!iframe) {
- console.warn('未找到iframe元素');
- return;
- }
- if (!iframe.contentWindow) {
- console.warn('iframe.contentWindow不可用');
- return;
- }
- const message = { StopActive: !isWitchaindRoute };
- // 向iframe发送消息,控制其活动状态 StopActive为false表示激活,为true表示停止
- let target = `${window.location.origin}/witchaind`;
- iframe.contentWindow.postMessage(message, target);
- },
- { immediate: true } // 初始化时也执行
-);
diff --git a/src/views/dialogue/dialogueView.vue b/src/views/dialogue/dialogueView.vue
index 549aba838bee46b378a4345800882d9ba5877a55..cc0fc69c4a1a49b78e3e6cdeb6457b45e04dddbb 100644
--- a/src/views/dialogue/dialogueView.vue
+++ b/src/views/dialogue/dialogueView.vue
@@ -215,7 +215,7 @@ const changeLanguagefun = (lang: 'CN' | 'EN') => {
// 同步语言到iframe
const iframe = document.querySelector('#my-iframe');
if (iframe?.contentWindow) {
- const data = { lang: localStorage.getItem('localeLang') };
+ const data = { lang: localStorage.getItem('localeLang') ?? 'CN' };
let target = `${window.location.origin}/witchaind`;
iframe.contentWindow.postMessage(data, target);
}
@@ -398,10 +398,10 @@ watch(
-
+
-
+
+
+
+
\ No newline at end of file