From 81a5e85a3a1c0c7c7ad05d18368b32c30597150b Mon Sep 17 00:00:00 2001 From: ivamp Date: Sun, 13 Oct 2024 21:08:02 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20=E7=99=BB=E5=BD=95?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/auth/callback.vue | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/pages/auth/callback.vue b/src/pages/auth/callback.vue index bf630af..29aa2a1 100644 --- a/src/pages/auth/callback.vue +++ b/src/pages/auth/callback.vue @@ -23,6 +23,11 @@ axios.get(config.oauth_discovery_url).then((discovery) => { const code: any = router.currentRoute.value.query.code; + if (!code) { + // console.log("无法获取当前 url 中的 code") + return; + } + // 从当前页面请求中获取 code const q = new URLSearchParams({ client_id: config.oauth_client_id, @@ -43,7 +48,7 @@ axios.get(config.oauth_discovery_url).then((discovery) => { r.data.id_token, r.data.access_token, r.data.refresh_token, - r.data.expires_in, + r.data.expires_in ); }) .catch((e) => {