From ad55441bf61800c6ba67e8fd944ae9a97421cdcb Mon Sep 17 00:00:00 2001 From: Xwen <929716663@qq.com> Date: Wed, 10 Jan 2024 23:24:12 +0800 Subject: [PATCH] =?UTF-8?q?postMessage=E6=95=B0=E6=8D=AE=E8=BD=AC=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Yi.Bbs.Vue3/src/views/Auth/index.vue | 4 +--- Yi.Bbs.Vue3/src/views/login/index.vue | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/Yi.Bbs.Vue3/src/views/Auth/index.vue b/Yi.Bbs.Vue3/src/views/Auth/index.vue index 03a57b53..808ea014 100644 --- a/Yi.Bbs.Vue3/src/views/Auth/index.vue +++ b/Yi.Bbs.Vue3/src/views/Auth/index.vue @@ -50,11 +50,9 @@ watch( } } window.opener.postMessage({ - authData: authData.value, + authData: JSON.stringify(authData.value), type: scheme.value, }); - console.log(authData.value); - console.log(JSON.stringify(authData.value), "发送过来的值"); message.value = "授权成功"; closeWindow(); } diff --git a/Yi.Bbs.Vue3/src/views/login/index.vue b/Yi.Bbs.Vue3/src/views/login/index.vue index 414031ae..818e35f1 100644 --- a/Yi.Bbs.Vue3/src/views/login/index.vue +++ b/Yi.Bbs.Vue3/src/views/login/index.vue @@ -323,7 +323,7 @@ window.addEventListener("message", async (e) => { const { authData, type } = e.data; console.log(authData, "传到登录页的值"); if (authData) { - await loginSuccess({ data: authData }); + await loginSuccess({ data: JSON.parse(authData) }); window.close(); } });