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
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 >
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 >
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 >
9191</template >
9292
9393<script setup lang="ts">
94- import { ref , computed , defineModel } from ' vue'
94+ import {ref , computed , defineModel } from ' vue'
9595import useStore from ' @/stores'
9696import HistoryPanel from ' @/views/chat/component/HistoryPanel.vue'
9797import ResetPassword from ' @/layout/layout-header/avatar/ResetPassword.vue'
98- import type { ResetCurrentUserPasswordRequest } from ' @/api/type/user'
98+ import type {ResetCurrentUserPasswordRequest } from ' @/api/type/user'
9999import 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 ()
103104const show = defineModel <boolean >(' show' )
104105
105106const props = defineProps <{
@@ -111,7 +112,7 @@ const props = defineProps<{
111112
112113const emit = defineEmits ([' newChat' , ' clickLog' , ' deleteLog' , ' refreshFieldTitle' , ' clearChat' ])
113114
114- const { chatUser } = useStore ()
115+ const {chatUser} = useStore ()
115116
116117const clearChat = () => {
117118 emit (' clearChat' )
@@ -128,6 +129,7 @@ const handleClickList = (item: any) => {
128129const deleteChatLog = (row : any ) => {
129130 emit (' deleteLog' , row )
130131}
132+
131133function refreshFieldTitle(chatId : string , abstract : string ) {
132134 emit (' refreshFieldTitle' , chatId , abstract )
133135}
@@ -139,13 +141,18 @@ const openResetPassword = () => {
139141
140142const handleResetPassword = (param : ResetCurrentUserPasswordRequest ) => {
141143 chatAPI .resetCurrentPassword (param ).then (() => {
142- router .push ({ name: ' login' })
144+ router .push ({name: ' login' })
143145 })
144146}
145147
146148const 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