From 74efef904f5e05035000a372c84afb43f8909852 Mon Sep 17 00:00:00 2001 From: wxg0103 <727495428@qq.com> Date: Sun, 28 Sep 2025 14:45:16 +0800 Subject: [PATCH] feat: enhance logout logic to handle different user source types --- ui/src/api/type/user.ts | 1 + ui/src/layout/layout-header/avatar/index.vue | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ui/src/api/type/user.ts b/ui/src/api/type/user.ts index 1ece7c83b..094b3d31b 100644 --- a/ui/src/api/type/user.ts +++ b/ui/src/api/type/user.ts @@ -29,6 +29,7 @@ interface User { language?: string workspace_list?: Array role_name?: Array + source?: string } interface LoginRequest { diff --git a/ui/src/layout/layout-header/avatar/index.vue b/ui/src/layout/layout-header/avatar/index.vue index f5f9d7be1..3fdb96808 100644 --- a/ui/src/layout/layout-header/avatar/index.vue +++ b/ui/src/layout/layout-header/avatar/index.vue @@ -188,7 +188,11 @@ const openResetPassword = () => { const logout = () => { login.logout().then(() => { - router.push({name: 'login', query: {login_mode: 'manual'}}) + if (user?.userInfo?.source && ['CAS', 'OIDC', 'OAuth2'].includes(user.userInfo.source)) { + router.push({name: 'login', query: {login_mode: 'manual'}}) + } else { + router.push({name: 'login'}) + } }) }