diff --git a/ui/src/conversation-panel/left-sidebar/account-menu/index.vue b/ui/src/conversation-panel/left-sidebar/account-menu/index.vue index d7bd16927b7..6183b57f53a 100644 --- a/ui/src/conversation-panel/left-sidebar/account-menu/index.vue +++ b/ui/src/conversation-panel/left-sidebar/account-menu/index.vue @@ -28,11 +28,17 @@ const tokenPercentage = computed(() => { const userPwdDialogRef = useTemplateRef>('userPwdDialogRef') const apiKeyDialogRef = useTemplateRef>('apiKeyDialogRef') -// 退出对话账号后重新导航,由守卫处理后续认证。 +// 退出对话账号后回到当前场景首页,不停留在上一用户的对话;由守卫决定匿名认证或跳转登录页。 const handleLogout = () => { return auth .logout() - .then(() => router.replace({ path: router.currentRoute.value.fullPath, force: true })) + .then(() => + router.replace( + route.meta.portal + ? { name: 'portal-application-list', force: true } + : { name: 'chat-home', params: { accessToken: route.params.accessToken }, force: true }, + ), + ) .catch(() => {}) }