From 379330ba22e9549e56bcd5c9b066258ce17daa8f Mon Sep 17 00:00:00 2001 From: junleea <354425203@qq.com> Date: Tue, 13 May 2025 13:58:47 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=AC=AC=E4=B8=89=E6=96=B9?= =?UTF-8?q?=E7=99=BB=E5=BD=95=E8=B7=B3=E8=BD=AC=E4=BD=BF=E7=94=A8=E6=96=B0?= =?UTF-8?q?=E7=9A=84=E6=B5=8F=E8=A7=88=E5=99=A8=E7=AA=97=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/pages/login.vue | 19 +++++++++++-------- src/views/pages/ucenter.vue | 11 ++++++++++- 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/src/views/pages/login.vue b/src/views/pages/login.vue index 5d3c461..d434689 100644 --- a/src/views/pages/login.vue +++ b/src/views/pages/login.vue @@ -235,7 +235,17 @@ const thirdLogin = async (type) => { } }, 2000); //新标签页打开登录地址 - window.open(loginUrl, "_blank"); + //window.open(loginUrl, "_blank"); + + //新的浏览器窗口打开标签页 + const width = 800; + const height = 600; + // 计算窗口在屏幕中心的位置 + const left = (window.screen.width - width) / 2; + const top = (window.screen.height - height) / 2; + const features = `width=${width},height=${height},left=${left},top=${top}`; + // 创建新窗口 + const newWindow = window.open(loginUrl, '_blank', features); }; @@ -372,13 +382,6 @@ const getMyUserInfo = async (id) => { text-align: center; } -.login-btn { - width: 100%; - height: 40px; - line-height: 40px; - border-radius: 5px; - font-size: 16px; -} .github-btn { background-image: url(../../assets/img/github-logo.png) !important; } diff --git a/src/views/pages/ucenter.vue b/src/views/pages/ucenter.vue index 5e96f34..62550eb 100644 --- a/src/views/pages/ucenter.vue +++ b/src/views/pages/ucenter.vue @@ -459,7 +459,16 @@ const thirdLogin = async (type) => { } }, 2000); //新标签页打开登录地址 - window.open(loginUrl, "_blank"); +// window.open(loginUrl, "_blank"); + //新的浏览器窗口打开标签页 + const width = 800; + const height = 600; + // 计算窗口在屏幕中心的位置 + const left = (window.screen.width - width) / 2; + const top = (window.screen.height - height) / 2; + const features = `width=${width},height=${height},left=${left},top=${top}`; + // 创建新窗口 + const newWindow = window.open(loginUrl, '_blank', features); }; //获取绑定的第三方账号信息