Skip to content

Commit

Permalink
bugfix(chat):修复加入聊天后聊天id显示为undefined的bug
Browse files Browse the repository at this point in the history
  • Loading branch information
li1553770945 committed Nov 24, 2024
1 parent 1e06991 commit c234c3c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/store/roomStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export const useRoomStore = defineStore('room', () => {
curRoomId.value = data.roomId;
clientId.value = data.clientId;
clientToken.value = data.clientToken;
lastRoomId.value = data.roomId;
localStorage.setItem("clientToken", data.clientToken);
localStorage.setItem("roomId", data.roomId);
localStorage.setItem("clientId", data.clientId);
Expand Down Expand Up @@ -62,14 +63,15 @@ export const useRoomStore = defineStore('room', () => {
return false;
} else {
data = data.data
curRoomId.value = data.roomId;
curRoomId.value = roomId;
clientId.value = data.clientId;
clientToken.value = data.clientToken;
lastRoomId.value = roomId;
localStorage.setItem("clientToken", data.clientToken);
localStorage.setItem("roomId", roomId);
localStorage.setItem("clientId", data.clientId);
ElNotification({
title: '加入房间成功,房间id:' + curRoomId.value,
title: '加入房间成功,房间id:' + roomId,
type: 'success',
})

Expand Down

0 comments on commit c234c3c

Please sign in to comment.