Skip to content

Commit f780278

Browse files
committed
fix: improve formatting and consistency in ChatHistoryDrawer.vue
1 parent 15ec70c commit f780278

File tree

1 file changed

+19
-12
lines changed

1 file changed

+19
-12
lines changed

ui/src/views/chat/embed/component/ChatHistoryDrawer.vue

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
>
1111
<el-button class="collapse cursor" circle @click="show = !show">
1212
<el-icon>
13-
<component :is="!show ? 'ArrowRightBold' : 'ArrowLeftBold'" />
13+
<component :is="!show ? 'ArrowRightBold' : 'ArrowLeftBold'"/>
1414
</el-icon>
1515
</el-button>
1616
<HistoryPanel
@@ -32,12 +32,12 @@
3232
chatUser.chat_profile.authentication_type === 'password'
3333
"
3434
>
35-
<img src="@/assets/user-icon.svg" style="width: 54%" alt="" />
35+
<img src="@/assets/user-icon.svg" style="width: 54%" alt=""/>
3636
</el-avatar>
3737
<el-dropdown v-else trigger="click" type="primary" class="w-full">
3838
<div class="flex align-center">
3939
<el-avatar :size="32">
40-
<img src="@/assets/user-icon.svg" style="width: 54%" alt="" />
40+
<img src="@/assets/user-icon.svg" style="width: 54%" alt=""/>
4141
</el-avatar>
4242
<span class="ml-8 color-text-primary">{{ chatUser.chatUserProfile?.nick_name }}</span>
4343
</div>
@@ -47,7 +47,7 @@
4747
<div class="flex align-center p-8">
4848
<div class="mr-8 flex align-center">
4949
<el-avatar :size="40">
50-
<img src="@/assets/user-icon.svg" style="width: 54%" alt="" />
50+
<img src="@/assets/user-icon.svg" style="width: 54%" alt=""/>
5151
</el-avatar>
5252
</div>
5353
<div>
@@ -72,7 +72,7 @@
7272
style="padding-top: 8px; padding-bottom: 8px"
7373
@click="logout"
7474
>
75-
<AppIcon iconName="app-export" class="color-secondary" />
75+
<AppIcon iconName="app-export" class="color-secondary"/>
7676
{{ $t('layout.logout') }}
7777
</el-dropdown-item>
7878
</el-dropdown-menu>
@@ -91,15 +91,16 @@
9191
</template>
9292

9393
<script setup lang="ts">
94-
import { ref, computed, defineModel } from 'vue'
94+
import {ref, computed, defineModel} from 'vue'
9595
import useStore from '@/stores'
9696
import HistoryPanel from '@/views/chat/component/HistoryPanel.vue'
9797
import ResetPassword from '@/layout/layout-header/avatar/ResetPassword.vue'
98-
import type { ResetCurrentUserPasswordRequest } from '@/api/type/user'
98+
import type {ResetCurrentUserPasswordRequest} from '@/api/type/user'
9999
import chatAPI from '@/api/chat/chat'
100-
import { useRouter } from 'vue-router'
101-
const router = useRouter()
100+
import {useRoute, useRouter} from 'vue-router'
102101
102+
const router = useRouter()
103+
const route = useRoute()
103104
const show = defineModel<boolean>('show')
104105
105106
const props = defineProps<{
@@ -111,7 +112,7 @@ const props = defineProps<{
111112
112113
const emit = defineEmits(['newChat', 'clickLog', 'deleteLog', 'refreshFieldTitle', 'clearChat'])
113114
114-
const { chatUser } = useStore()
115+
const {chatUser} = useStore()
115116
116117
const clearChat = () => {
117118
emit('clearChat')
@@ -128,6 +129,7 @@ const handleClickList = (item: any) => {
128129
const deleteChatLog = (row: any) => {
129130
emit('deleteLog', row)
130131
}
132+
131133
function refreshFieldTitle(chatId: string, abstract: string) {
132134
emit('refreshFieldTitle', chatId, abstract)
133135
}
@@ -139,13 +141,18 @@ const openResetPassword = () => {
139141
140142
const handleResetPassword = (param: ResetCurrentUserPasswordRequest) => {
141143
chatAPI.resetCurrentPassword(param).then(() => {
142-
router.push({ name: 'login' })
144+
router.push({name: 'login'})
143145
})
144146
}
145147
146148
const logout = () => {
147149
chatUser.logout().then(() => {
148-
router.push({ name: 'login' })
150+
router.push({
151+
name: 'login',
152+
params: {accessToken: chatUser.accessToken},
153+
query: route.query,
154+
})
155+
149156
})
150157
}
151158
</script>

0 commit comments

Comments
 (0)