Browse Source

fix:修复工作台聊天功能异常

master
qiutianhong 7 months ago
parent
commit
c2c9979e87
  1. 1
      frontend/components.d.ts
  2. 141
      frontend/src/components/chat/Chat.vue
  3. 7
      frontend/src/components/chat/ChatBox.vue
  4. 11
      frontend/src/components/chat/ChatMenu.vue
  5. 9
      frontend/src/components/chat/ChatMsgList.vue
  6. 80
      frontend/src/components/chat/ChatUserList.vue
  7. 287
      frontend/src/stores/chat.ts
  8. 2
      frontend/src/stores/upgrade.ts

1
frontend/components.d.ts

@ -88,6 +88,7 @@ declare module 'vue' {
ElText: typeof import('element-plus/es')['ElText']
ElTooltip: typeof import('element-plus/es')['ElTooltip']
ElTree: typeof import('element-plus/es')['ElTree']
ElUpload: typeof import('element-plus/es')['ElUpload']
Error: typeof import('./src/components/taskbar/Error.vue')['default']
FileIcon: typeof import('./src/components/builtin/FileIcon.vue')['default']
FileIconImg: typeof import('./src/components/builtin/FileIconImg.vue')['default']

141
frontend/src/components/chat/Chat.vue

@ -19,7 +19,7 @@
const data = ref(generateData());
// users any[]
const users = ref<any[]>([]);
const users = ref<any[]>([]);
watchEffect(() => {
if (store.allUserList.length > 0) {
@ -27,18 +27,18 @@ const users = ref<any[]>([]);
}
});
function toggleSelectItem(item: any) {
const index = users.value.indexOf(item.key);
if (index === -1) {
users.value.push(item.key);
} else {
users.value.splice(index, 1);
function toggleSelectItem(item: any) {
const index = users.value.indexOf(item.key);
if (index === -1) {
users.value.push(item.key);
} else {
users.value.splice(index, 1);
}
}
}
function removeItem(userId:string) {
users.value = users.value.filter((user) => user !== userId);
}
function removeItem(userId: string) {
users.value = users.value.filter((user) => user !== userId);
}
</script>
<template>
<el-container class="container">
@ -107,10 +107,22 @@ function removeItem(userId:string) {
>
<div class="dialog-body">
<!-- 添加输入部门名的输入框 -->
<el-input
v-model="store.departmentName"
placeholder="请输入群聊名称"
></el-input>
<el-form
label-position="top"
>
<el-form-item label="群聊名称:">
<el-input
style="width: 240px"
class="department-name"
v-model="store.departmentName"
placeholder="请输入群聊名称"
></el-input>
</el-form-item>
<el-upload>
</el-upload>
</el-form>
<div class="transfer-container">
<!-- 自定义穿梭框组件 -->
<div class="transfer-box">
@ -150,7 +162,8 @@ function removeItem(userId:string) {
:key="user"
>
<span>{{
data.find((item: any) => item.key === user)?.label
data.find((item: any) => item.key === user)
?.label
}}</span>
<span
class="remove-icon"
@ -185,12 +198,12 @@ function removeItem(userId:string) {
width: 100%;
overflow-y: hidden;
overflow-x: hidden;
border-top: 1px solid #e8e8e8;
}
.menu {
width: 55px;
background-color: #f0f0f0;
background-color: #ffffff;
overflow-y: hidden;
overflow-x: hidden;
-webkit-app-region: drag;
@ -209,11 +222,14 @@ function removeItem(userId:string) {
display: flex;
align-items: center;
justify-content: space-evenly;
width: 90%;
width: 100%;
/* 占据整个宽度 */
height: 50px;
padding: 0;
padding-right: 10px;
-webkit-app-region: drag;
border-bottom: 1px solid #e8e8e8;
border-left: 1px solid #e8e8e8;
}
.inviteGroupChats {
width: 40px;
@ -242,10 +258,13 @@ function removeItem(userId:string) {
.list {
width: 100%;
height: 100%;
/* 占据整个宽度 */
padding: 0;
overflow-y: hidden;
overflow-x: hidden;
border-left: 1px solid #e8e8e8;
/* border-right: 1px solid #E8E8E8; */
}
.dialog-body {
width: 100%;
@ -288,52 +307,54 @@ function removeItem(userId:string) {
justify-content: center;
}
.transfer-box {
display: flex;
gap: 0;
}
.transfer-box {
display: flex;
gap: 0px;
}
.list-box {
width: 50%;
border-top: 1px solid #ccc;
margin-top: 10px;
}
.list-box {
width: 50%;
border: 1px solid #ccc;
border-radius: 5px;
padding: 10px;
box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);
}
.list-box ul {
list-style: none;
padding: 0;
margin: 0;
}
.list-box ul {
list-style: none;
padding: 0;
margin: 0;
}
.list-box li {
display: flex;
align-items: center;
padding: 5px 0;
cursor: pointer;
transition: background-color 0.2s;
}
.list-box li:hover {
background-color: #f0f8ff;
}
.list-box li {
display: flex;
align-items: center;
padding: 5px 0;
cursor: pointer;
transition: background-color 0.2s;
}
.list-box li:hover {
background-color: #f0f8ff;
}
.list-box li.selected {
background-color: #e6f7ff;
}
.list-box li.selected {
background-color: #e6f7ff;
}
input[type="checkbox"] {
margin-right: 8px;
}
input[type="checkbox"] {
margin-right: 8px;
}
.remove-icon {
margin-left: auto;
color: #d32f2f;
cursor: pointer;
font-size: 14px;
}
.remove-icon {
margin-left: auto;
color: #d32f2f;
cursor: pointer;
font-size: 14px;
}
.remove-icon:hover {
color: #ff5a5a;
}
.remove-icon:hover {
color: #ff5a5a;
}
.department-name {
margin: 10px 0;
}
</style>

7
frontend/src/components/chat/ChatBox.vue

@ -126,14 +126,15 @@
const store: any = useChatStore();
const choose = useChooseStore();
const imgExt = ["png", "jpg", "jpeg", "gif", "bmp", "webp", "svg"];
const choosetype = ref("image");
const choosetype = ref("");
function selectImg() {
choosetype.value = "image";
console.log(choosetype.value)
choose.select("选择图片", imgExt);
}
function selectFile() {
console.log("selectFile")
console.log("selectFile");
choosetype.value = "applyfile";
choose.select("选择文件", "*");
}
@ -194,6 +195,7 @@
border-color: #d6d6d6;
border-style: solid;
}
.msg-footer {
width: 100%;
@ -276,7 +278,6 @@
}
.no-message-container {
height: 100%;
margin: 120px auto;
text-align: center;
justify-content: center;

11
frontend/src/components/chat/ChatMenu.vue

@ -82,7 +82,7 @@ const store = useChatStore();
<style scoped>
.userAvatar {
margin: 30px auto 10px;
margin: 6px auto;
-webkit-app-region: no-drag;
}
@ -93,13 +93,12 @@ const store = useChatStore();
width: 40px;
height: 40px;
margin: 10px auto;
border-radius: 15%;
/* background-color: #bae7ff; */
/* border-radius: 15%; */
transition: all 0.5s;
}
.menu-icon-box:hover {
/* .menu-icon-box:hover {
background-color: #d9d9d9;
}
} */
.menu-icon {
margin: 0px auto;
@ -110,7 +109,7 @@ const store = useChatStore();
.menu-icon-on {
margin: 0px auto;
font-size: 25px;
color: #1890ff;
color: #2A6BF2;
cursor: pointer;
}
</style>

9
frontend/src/components/chat/ChatMsgList.vue

@ -9,7 +9,7 @@
@click="store.getSessionInfo(item.chatId, item.type)"
:style="{
backgroundColor:
item.chatId == store.targetChatId ? '#bae7ff' : '',
item.chatId == store.targetChatId ? '#EAF3FC' : '',
}"
>
<el-row>
@ -74,17 +74,16 @@
<style scoped>
.list-item {
width: 94%;
width: 100%;
height: 60px;
display: flex;
margin: 0 auto;
border-radius: 4px;
transition: all 0.5s;
margin-top: 5px;
overflow: hidden;
}
.list-item:hover {
background-color: #bae7ff;
background-color: #eaf3fc;
}
.avatar {

80
frontend/src/components/chat/ChatUserList.vue

@ -108,6 +108,7 @@
</div>
</div>
</div>
<div v-else>
<p class="no-data">暂无数据</p>
</div>
@ -138,34 +139,7 @@
@node-click="handleNodeClick"
:default-expand-all="false"
>
<!-- <template #default="{ node, data }">
<div
class="list-item"
@click="store.changeGroupList(data)"
:style="{
backgroundColor:
data.dept_id === store.targetGroupId
? '#C4C4C4'
: '',
}"
>
<el-row>
<el-col :span="6">
<el-avatar
shape="square"
:size="40"
class="avatar"
:src="data.avatar || ''"
/>
</el-col>
<el-col :span="18">
<div class="preview-name">
{{ data.dept_name }}
</div>
</el-col>
</el-row>
</div>
</template> -->
</el-tree>
</div>
@ -173,6 +147,54 @@
<p class="no-data">暂无数据</p>
</div>
</el-collapse-item>
<el-collapse-item name="3">
<template #title>
<span
v-if="store.groupList.length > 0"
class="title"
>群组{{ store.groups.length }}</span
>
<span
v-else
class="title"
>群组</span
>
</template>
<div v-if="store.groupList.length > 0">
<div
v-for="group in store.groups"
:key="group.id"
>
<div
class="list-item"
@click="store.getSessionInfo(group.id, 'group')"
:style="{
backgroundColor:
group.id === store.targetChatId
? '#bae7ff'
: '',
}"
>
<el-row>
<el-col :span="6">
<el-avatar
shape="square"
:size="40"
class="avatar"
:src="group.avatar"
/>
</el-col>
<el-col :span="18">
<div class="previewName">{{ group.name }}</div>
</el-col>
</el-row>
</div>
</div>
</div>
<div v-else>
<p class="no-data">暂无数据</p>
</div>
</el-collapse-item>
</el-collapse>
</template>
@ -190,7 +212,7 @@
}
.list-item:hover {
/* background-color: #bae7ff; */
background-color: #bae7ff;
}
.avatar {

287
frontend/src/stores/chat.ts

@ -1,6 +1,6 @@
import emojiList from "@/assets/emoji.json";
import { fetchGet, fetchPost, getSystemConfig } from '@/system/config';
import { notifySuccess } from "@/util/msg";
import { notifyError, notifySuccess } from "@/util/msg";
import { defineStore } from 'pinia';
import { db } from "./db";
@ -8,7 +8,7 @@ export const useChatStore = defineStore('chatStore', () => {
interface OnlineUserInfoType {
id: string;
ip: string;
login_ip: string;
avatar: string;
online: boolean;
type: string;
@ -20,7 +20,7 @@ export const useChatStore = defineStore('chatStore', () => {
interface ChatMessageType {
type: string;
content_type: string;
time: string;
time: number;
userId: number;
toUserId: number;
message: string;
@ -32,7 +32,7 @@ export const useChatStore = defineStore('chatStore', () => {
const Message: ChatMessageType = {
type: '',
content_type: '',
time: new Date().toISOString(),
time: 0,
userId: 0,
toUserId: 0,
message: '',
@ -89,6 +89,7 @@ export const useChatStore = defineStore('chatStore', () => {
const targetUserInfo: any = ref({});
const targetChatId = ref();
const search = ref('');
const groups: any = ref([])
// 群成员列表
const groupMemberList = ref([])
@ -124,16 +125,18 @@ export const useChatStore = defineStore('chatStore', () => {
await getGroupList()
// 初始化聊天列表
initChatList()
// 获取部门列表
getDepartmentList()
// 获取所有列表
getAllList()
};
// 获取部门列表
const getDepartmentList = async () => {
const getAllList = async () => {
const res = await fetchGet(userInfo.value.url + "/chat/user/list")
console.log(res);
if (res.ok) {
const data = await res.json();
console.log(data)
groups.value = data.data.groups;
departmentList.value = data.data.users;
}
}
@ -161,7 +164,7 @@ export const useChatStore = defineStore('chatStore', () => {
await sendTextMessage()
}
if (messageType == 'image') {
sendImageMessage()
await sendImageMessage()
}
console.log(messageType)
@ -195,7 +198,7 @@ export const useChatStore = defineStore('chatStore', () => {
}
console.log(Message)
// 发送文件消息
const res = await fetchPost(config.userInfo.url + '/chat/send/file', JSON.stringify(Message));
const res = await fetchPost(config.userInfo.url + '/chat/send', JSON.stringify(Message));
if (!res.ok) {
fileSendActive.value = false;
return;
@ -215,7 +218,11 @@ export const useChatStore = defineStore('chatStore', () => {
console.log("messageHistory------", messageHistory)
// 添加到聊天记录
await db.addOne("workbenchGroupChatRecord", messageHistory);
if (Message.type === 'group') {
await db.addOne("workbenchGroupChatRecord", messageHistory);
} else if (Message.type === 'user') {
await db.addOne("workbenchChatRecord", messageHistory);
}
chatHistory.value.push(messageHistory);
fileSendActive.value = true;
notifySuccess('文件发送成功');
@ -228,7 +235,6 @@ export const useChatStore = defineStore('chatStore', () => {
// 发送文件消息
const sendFileMessage = async () => {
// 判断是群聊发送还是单聊发送
if (targetGroupInfo.value && Object.keys(targetGroupInfo.value).length > 0) {
console.log('群聊发送文件');
@ -251,13 +257,17 @@ export const useChatStore = defineStore('chatStore', () => {
}
console.log(Message)
// 发送文件消息
const res = await fetchPost(config.userInfo.url + '/chat/send/file', JSON.stringify(Message));
console.log("token", config.userInfo.token)
const res = await fetchPost(config.userInfo.url + '/chat/send', JSON.stringify(Message));
console.log(res)
if (!res.ok) {
fileSendActive.value = false;
return;
}
const data = await res.json();
console.log(data);
console.log("", data);
// 封装成消息历史记录
const messageHistory = {
@ -271,7 +281,11 @@ export const useChatStore = defineStore('chatStore', () => {
console.log("messageHistory------", messageHistory)
// 添加到聊天记录
await db.addOne("workbenchGroupChatRecord", messageHistory);
if (Message.type === 'group') {
await db.addOne("workbenchGroupChatRecord", messageHistory);
} else if (Message.type === 'user') {
await db.addOne("workbenchChatRecord", messageHistory);
}
chatHistory.value.push(messageHistory);
fileSendActive.value = true;
notifySuccess('文件发送成功');
@ -307,11 +321,11 @@ export const useChatStore = defineStore('chatStore', () => {
Message.userInfo = {}
}
console.log("token", config.userInfo.token)
// 发送消息
const res = await fetchPost(config.userInfo.url + '/chat/send', JSON.stringify(Message));
if (res.ok) {
console.log(await res.json())
// 封装成消息历史记录
var messageHistory
// 本地存储一份聊天记录
@ -338,8 +352,6 @@ export const useChatStore = defineStore('chatStore', () => {
// 更新聊天历史
chatHistory.value.push(messageHistory);
console.log(await res.json())
// 清空输入框
clearMessage();
@ -481,6 +493,16 @@ export const useChatStore = defineStore('chatStore', () => {
// 创建群聊
const createGroupChat = async (userIds: number[]) => {
if (userIds.length === 0) {
notifyError('请选择用户')
return false
}
if (departmentName.value === '') {
notifyError('请输入群名')
return false
}
const currUserId = userInfo.value.id;
// 将当前用户的 ID 添加到 user_ids 数组中
const newUserIds = [currUserId, ...userIds]
@ -520,9 +542,10 @@ export const useChatStore = defineStore('chatStore', () => {
initChatList()
// 关闭对话弹窗
setGroupChatInvitedDialogVisible(false)
await getAllList()
};
// 处用户消息
// 处���用户消息
const userChatMessage = async (data: any) => {
// 先判断数据库是否有该用户
// 更新聊天记录表
@ -624,106 +647,174 @@ export const useChatStore = defineStore('chatStore', () => {
const onlineUserData = async (data: OnlineUserInfoType[]) => {
// 创建一个用户数组,将所有在线的用户提取出来
const onlineUsers: OnlineUserInfoType[] = [];
// 遍历每个数据项
data.forEach((item: any) => {
if (item.id && item.login_ip) {
onlineUsers.push({
id: item.id,
ip: item.login_ip,
type: "user",
chatId: item.id,
online: true,
avatar: item.avatar,
username: item.username,
nickname: item.nickname
});
}
});
// 将提取到的用户数据传递给
const onlineUsers: OnlineUserInfoType[] = data.map(item => ({
id: item.id,
login_ip: item.login_ip,
type: "user",
chatId: item.id,
online: true,
avatar: item.avatar || '/default_avatar.png', // 使用默认头像如果没有提供
username: item.username,
nickname: item.nickname
})).filter(item => item.id && item.login_ip); // 确保所有项都有有效的id和ip
// 更新在线用户列表
if (onlineUsers.length > 0) {
await setOnlineUserList(onlineUsers);
}
};
const setOnlineUserList = async (data: OnlineUserInfoType[]) => {
if (data.length < 1) {
return;
// 从数据库中获取所有用户信息
const allUsers = await db.getAll("workbenchChatUser");
const onlineUserIds = new Set(data.map(user => user.id));
// 筛选出需要删除的用户(即不在在线列表中的用户)
const usersToDelete = allUsers.filter((user: { id: string; }) => !onlineUserIds.has(user.id));
const deleteIds = usersToDelete.map((user: { id: any; }) => user.id);
// 删除不在在线列表中的用户
if (deleteIds.length > 0) {
await db.table("workbenchChatUser").bulkDelete(deleteIds);
}
// 从当前用户列表中获取已有用户的 IP 和完整用户映射
const existingIps = new Set(onlineUserList.value.map((d: any) => d.ip));
const userMap = new Map<string, OnlineUserInfoType>(
onlineUserList.value.map((user: OnlineUserInfoType) => [user.ip, user])
);
const updates: any[] = [];
const newEntries: any[] = [];
// 遍历传入的 data,每个用户根据是否存在来更新或添加
data.forEach((d: any) => {
const existingUser = userMap.get(d.ip);
if (existingUser && existingIps.has(d.ip)) {
// 若用户已存在,添加到更新列表
updates.push({
key: existingUser.id,
changes: {
isOnline: true,
avatar: d.avatar,
nickname: d.nickname,
username: d.username,
updatedAt: Date.now()
}
// 添加或更新在线用户
for (const user of data) {
const existingUser = allUsers.find((u: { id: string; }) => u.id === user.id);
if (existingUser) {
// 更新现有用户
await db.table("workbenchChatUser").update(user.id, {
...existingUser,
isOnline: true,
avatar: user.avatar,
nickname: user.nickname,
username: user.username,
updatedAt: Date.now()
});
} else {
// 若用户不存在,添加到新条目列表
newEntries.push({
id: d.id,
ip: d.ip,
// 添加新用户
await db.table("workbenchChatUser").add({
id: user.id,
login_ip: user.login_ip,
type: "user",
chatId: d.id,
chatId: user.id,
isOnline: true,
avatar: d.avatar,
nickname: d.nickname,
username: d.usernmae,
avatar: user.avatar,
nickname: user.nickname,
username: user.username,
createdAt: Date.now(),
updatedAt: Date.now()
});
}
});
// 批量更新和添加用户数据
if (updates.length > 0) {
await db.table("workbenchChatUser").bulkUpdate(updates);
}
if (newEntries.length > 0) {
await db.table("workbenchChatUser").bulkPut(newEntries);
}
initOnlineUserList()
// 重新初始化在线用户列表,确保所有用户都被显示
await initOnlineUserList();
};
const initOnlineUserList = async () => {
// 从数据库中获取所有用户信息
const list = await db.getAll("workbenchChatUser");
// 创建一个 Map,用于存储每个用户的唯一 ID 地址
let uniqueIdMap = new Map<string, any>();
// 遍历用户列表,将每个用户添加到 Map 中(基于 ID 去重)
list.forEach((item: any) => {
uniqueIdMap.set(item.userId, item); // 使用 ID 作为键,用户对象作为值
});
// 将 Map 的值转换为数组(去重后的用户列表)
const uniqueIdList = Array.from(uniqueIdMap.values());
// 按照 updatedAt 时间进行升序排序
uniqueIdList.sort((a: any, b: any) => a.time - b.time);
// 更新用户列表
onlineUserList.value = uniqueIdList;
onlineUserList.value = list;
};
// const onlineUserData = async (data: OnlineUserInfoType[]) => {
// // 创建一个用户数组,将所有在线的用户提取出来
// const onlineUsers: OnlineUserInfoType[] = data.map(item => ({
// id: item.id,
// login_ip: item.login_ip,
// type: "user",
// chatId: item.id,
// online: true,
// avatar: item.avatar || '/default_avatar.png', // 使用默认头像如果没有提供
// username: item.username,
// nickname: item.nickname
// })).filter(item => item.id && item.login_ip); // 确保所有项都有有效的id和ip
// // 更新在线用户列表
// if (onlineUsers.length > 0) {
// await setOnlineUserList(onlineUsers);
// }
// };
// const setOnlineUserList = async (data: OnlineUserInfoType[]) => {
// // 从当前用户列表中获取已有用户的 IP 和完整用户映射
// const existingIps = new Set(onlineUserList.value.map((d: any) => d.ip));
// const userMap = new Map<string, OnlineUserInfoType>(
// onlineUserList.value.map((user: OnlineUserInfoType) => [user.login_ip, user])
// );
// const updates: any[] = [];
// const newEntries: any[] = [];
// // 遍历传入的 data,每个用户根据是否存在来更新或添加
// data.forEach((d: any) => {
// const existingUser = userMap.get(d.ip);
// if (existingUser && existingIps.has(d.ip)) {
// // 若用户已存在,添加到更新列表
// updates.push({
// key: existingUser.id,
// changes: {
// isOnline: true,
// avatar: d.avatar,
// nickname: d.nickname,
// username: d.username,
// updatedAt: Date.now()
// }
// });
// } else {
// // 若用户不存在,添加到新条目列表
// newEntries.push({
// id: d.id,
// ip: d.ip,
// type: "user",
// chatId: d.id,
// isOnline: true,
// avatar: d.avatar,
// nickname: d.nickname,
// username: d.username,
// createdAt: Date.now(),
// updatedAt: Date.now()
// });
// }
// });
// // 批量更新和添加用户数据
// if (updates.length > 0) {
// await db.table("workbenchChatUser").bulkUpdate(updates);
// }
// if (newEntries.length > 0) {
// await db.table("workbenchChatUser").bulkPut(newEntries);
// }
// console.log(updates)
// console.log(newEntries)
// // 重新初始化在线用户列表,确保所有用户都被显示
// await initOnlineUserList();
// };
// const initOnlineUserList = async () => {
// // 从数据库中获取所有用户信息
// const list = await db.getAll("workbenchChatUser");
// // 创建一个 Map,用于存储每个用户的唯一 ID 地址
// let uniqueIdMap = new Map<string, any>();
// // 遍历用户列表,将每个用户添加到 Map 中(基于 ID 去重)
// list.forEach((item: any) => {
// uniqueIdMap.set(item.userId, item); // 使用 ID 作为键,用户对象作为值
// });
// // 将 Map 的值转换为数组(去重后的用户列表)
// const uniqueIdList = Array.from(uniqueIdMap.values());
// // 按照 updatedAt 时间进行升序排序
// uniqueIdList.sort((a: any, b: any) => a.time - b.time);
// // 更新用户列表
// onlineUserList.value = list;
// };
// 初始化统一用户列表状态
const initUserList = async () => {
if (!onlineUserList.value.length) return;
@ -824,7 +915,7 @@ export const useChatStore = defineStore('chatStore', () => {
};
const groupChatMessage = async (data: any) => {
console.log(data)
console.log("收到群消息了!!!!!")
// 创建消息记录
const messageRecord = {
userId: data.userId,
@ -845,15 +936,12 @@ export const useChatStore = defineStore('chatStore', () => {
if (messageRecord.userId === userInfo.value.id) {
return;
}
console.log(messageRecord)
// 将消息记录添加到数据库
const res = await db.addOne("workbenchGroupChatRecord", messageRecord);
console.log(res)
// 更改聊天记录
chatHistory.value.push(messageRecord)
};
const showContextMenu = (event: any, id: number) => {
@ -918,6 +1006,7 @@ export const useChatStore = defineStore('chatStore', () => {
sendInfo,
fileSendActive,
groupMemberList,
groups,
initChat,
showContextMenu,
setCurrentNavId,
@ -932,7 +1021,7 @@ export const useChatStore = defineStore('chatStore', () => {
onlineUserData,
groupChatMessage,
userChatMessage,
getDepartmentList,
getAllList,
getAllUser,
quitGroup,
};

2
frontend/src/stores/upgrade.ts

@ -70,7 +70,6 @@ export const useUpgradeStore = defineStore('upgradeStore', () => {
async function handleMessage(message: any) {
// console.log(message)
switch (message.type) {
case 'update':
checkUpdate(message.data)
@ -85,6 +84,7 @@ export const useUpgradeStore = defineStore('upgradeStore', () => {
chatChatStore.userChatMessage(message.data)
break
case 'group':
console.log(message)
chatChatStore.groupChatMessage(message.data);
break;
default:

Loading…
Cancel
Save