From feb1b2e8e90a20be458bd225874b7298bfd52d30 Mon Sep 17 00:00:00 2001 From: Gjm <你的邮箱> Date: Mon, 30 Mar 2026 11:13:17 +0800 Subject: [PATCH] =?UTF-8?q?fix(login):=20=E5=88=87=E6=8D=A2=E5=9B=9E?= =?UTF-8?q?=E7=94=9F=E4=BA=A7=E7=8E=AF=E5=A2=83=E7=9A=84=E7=BB=9F=E4=B8=80?= =?UTF-8?q?=E8=BA=AB=E4=BB=BD=E8=AE=A4=E8=AF=81=E5=9C=B0=E5=9D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在 login.vue 中将认证地址从本地开发地址切换回生产地址 - 在 Navbar.vue 中将登出跳转地址从本地开发地址切换回生产地址 - 移除本地测试配置,启用正确的认证服务器地址 - 确保单点登录功能在生产环境中正常工作 (cherry picked from commit 281c6d71b2a236852ea8ec2f5a9c0a6ac152054e) --- src/layout/components/Navbar.vue | 14 +++++++------- src/views/login.vue | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/layout/components/Navbar.vue b/src/layout/components/Navbar.vue index 59891fd..8aabcd1 100644 --- a/src/layout/components/Navbar.vue +++ b/src/layout/components/Navbar.vue @@ -79,23 +79,23 @@ export default { cancelButtonText: this.$t('cancel'), type: 'warning', }); - + // 先调用 CAS 退出接口 await this.outlogincasapi(); - + // 再执行 Store 退出 await this.$store.dispatch('LogOut'); - + // 清理本地存储 sessionStorage.clear(); localStorage.clear(); localStorage.setItem('is_logging_out', 'true'); // 跳转 // location.href = '/index'; - // window.location.href = 'http://192.168.1.241/login?redirect=/lig/oauth2/oauth2/application&appid=330b4ecb60c9a6802b957fe1e5a5ecd3&url=http%3A%2F%2F192.168.1.241%3A9000%2Flogin'+(this.redirect?'&ssUrl='+this.redirect:''); - window.location.href = 'http://localhost:81/login?redirect=/lig/oauth2/oauth2/application&appid=330b4ecb60c9a6802b957fe1e5a5ecd3&url=http%3A%2F%2Flocalhost%3A80%2Flogin'+(this.redirect?'&ssUrl='+this.redirect:''); - - + window.location.href = 'http://192.168.1.241/login?redirect=/lig/oauth2/oauth2/application&appid=330b4ecb60c9a6802b957fe1e5a5ecd3&url=http%3A%2F%2F192.168.1.241%3A9000%2Flogin'+(this.redirect?'&ssUrl='+this.redirect:''); + // window.location.href = 'http://localhost:81/login?redirect=/lig/oauth2/oauth2/application&appid=330b4ecb60c9a6802b957fe1e5a5ecd3&url=http%3A%2F%2Flocalhost%3A80%2Flogin'+(this.redirect?'&ssUrl='+this.redirect:''); + + } catch (error) { // 用户取消或出错时的处理 console.log('退出取消或失败', error); diff --git a/src/views/login.vue b/src/views/login.vue index fac787b..102e19f 100644 --- a/src/views/login.vue +++ b/src/views/login.vue @@ -309,8 +309,8 @@ export default { // 没有ticket且没有token,跳转统一身份认证 const isTs = true; if (isTs) { - // window.location.href = 'http://192.168.1.241/login?redirect=/lig/oauth2/oauth2/application&appid=330b4ecb60c9a6802b957fe1e5a5ecd3&url=http%3A%2F%2F192.168.1.241%3A9000%2Flogin'+(this.redirect?'&ssUrl='+this.redirect:''); - window.location.href = 'http://localhost:81/login?redirect=/lig/oauth2/oauth2/application&appid=330b4ecb60c9a6802b957fe1e5a5ecd3&url=http%3A%2F%2Flocalhost%3A80%2Flogin' + (this.redirect ? '&ssUrl=' + this.redirect : ''); + window.location.href = 'http://192.168.1.241/login?redirect=/lig/oauth2/oauth2/application&appid=330b4ecb60c9a6802b957fe1e5a5ecd3&url=http%3A%2F%2F192.168.1.241%3A9000%2Flogin'+(this.redirect?'&ssUrl='+this.redirect:''); + // window.location.href = 'http://localhost:81/login?redirect=/lig/oauth2/oauth2/application&appid=330b4ecb60c9a6802b957fe1e5a5ecd3&url=http%3A%2F%2Flocalhost%3A80%2Flogin' + (this.redirect ? '&ssUrl=' + this.redirect : ''); } } else if (ticket && !token) { // 有ticket但没有token,请求登录