feat: enhance logout logic to handle different user source types

This commit is contained in:
wxg0103 2025-09-28 14:45:16 +08:00
parent 0c0f30c58e
commit 74efef904f
2 changed files with 6 additions and 1 deletions

View File

@ -29,6 +29,7 @@ interface User {
language?: string
workspace_list?: Array<any>
role_name?: Array<any>
source?: string
}
interface LoginRequest {

View File

@ -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'})
}
})
}