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); }; //获取绑定的第三方账号信息