fix: update logout behavior to redirect to login page and clean up formatting in ChatHistoryDrawer.vue and ResetPasswordDrawer.vue

This commit is contained in:
wxg0103 2025-07-15 11:32:36 +08:00
parent ee8412f34d
commit 9cce06b9f1
3 changed files with 94 additions and 85 deletions

View File

@ -138,7 +138,7 @@ const openResetPassword = () => {
const handleResetPassword = (param: ResetCurrentUserPasswordRequest) => {
chatAPI.resetCurrentPassword(param).then(() => {
logout()
router.push({name: 'login'})
})
}

View File

@ -102,11 +102,9 @@ function resetPassword() {
resetPasswordFormRef.value?.validate().then(() => {
chatAPI.resetCurrentPassword(resetPasswordForm.value).then(() => {
MsgSuccess(t('common.modifySuccess'))
chatUser.logout().then(() => {
router.push({name: 'login'})
})
})
})
}
</script>

View File

@ -73,7 +73,9 @@
style="padding-top: 8px; padding-bottom: 8px"
@click="openResetPassword"
>
<el-icon><Lock /></el-icon>
<el-icon>
<Lock/>
</el-icon>
{{ $t('views.login.resetPassword') }}
</el-dropdown-item>
<el-dropdown-item
@ -221,9 +223,12 @@ import { useRouter } from 'vue-router'
import ResetPassword from '@/layout/layout-header/avatar/ResetPassword.vue'
import {t} from '@/locales'
import type {ResetCurrentUserPasswordRequest} from '@/api/type/user'
import ExecutionDetailContent from '@/components/ai-chat/component/knowledge-source-component/ExecutionDetailContent.vue'
import ParagraphSourceContent from '@/components/ai-chat/component/knowledge-source-component/ParagraphSourceContent.vue'
import ParagraphDocumentContent from '@/components/ai-chat/component/knowledge-source-component/ParagraphDocumentContent.vue'
import ExecutionDetailContent
from '@/components/ai-chat/component/knowledge-source-component/ExecutionDetailContent.vue'
import ParagraphSourceContent
from '@/components/ai-chat/component/knowledge-source-component/ParagraphSourceContent.vue'
import ParagraphDocumentContent
from '@/components/ai-chat/component/knowledge-source-component/ParagraphDocumentContent.vue'
import HistoryPanel from '@/views/chat/component/HistoryPanel.vue'
import {cloneDeep} from 'lodash'
@ -256,7 +261,7 @@ const openResetPassword = () => {
const handleResetPassword = (param: ResetCurrentUserPasswordRequest) => {
chatAPI.resetCurrentPassword(param).then(() => {
logout()
router.push({name: 'login'})
})
}
@ -284,7 +289,8 @@ const applicationDetail = computed({
get: () => {
return props.application_profile
},
set: (v) => {},
set: (v) => {
},
})
const chatLogData = ref<any[]>([])
@ -305,6 +311,7 @@ function refreshFieldTitle(chatId: string, abstract: string) {
find.abstract = abstract
}
}
function deleteLog(row: any) {
chatAPI.deleteChat(row.id, left_loading).then(() => {
if (currentChatId.value === row.id) {
@ -466,6 +473,7 @@ const rightPanelType = ref('')
const rightPanelLoading = ref(false)
const executionDetail = ref<any[]>([])
const rightPanelDetail = ref<any>()
async function openExecutionDetail(row: any) {
rightPanelSize.value = 400
rightPanelTitle.value = t('chat.executionDetails.title')
@ -534,10 +542,12 @@ function closeExecutionDetail() {
background: #ffffff;
height: 100%;
overflow: hidden;
.execution-detail-content {
flex: 1;
overflow: hidden;
height: calc(100% - 63px);
.execution-details {
padding: 16px;
}
@ -550,6 +560,7 @@ function closeExecutionDetail() {
max-width: 80%;
margin: 0 auto;
}
@media only screen and (max-width: 1000px) {
.chat-width {
max-width: 100% !important;