Browse Source

feat: 封装socket类

qinyuyue 2 months ago
parent
commit
19adb05c63
1 changed files with 3 additions and 10 deletions
  1. 3 10
      src/stores/useChats.js

+ 3 - 10
src/stores/useChats.js

@@ -13,13 +13,13 @@ export const useChatsStore = defineStore('chats', () => {
   }
 
   // 当前聊天会话管理
+
+  const currConversationLoading = ref(false)
   /**
    *
-   * @param type 聊天类型 单聊或者群聊
    * @param userId 聊天对象Id
    * @returns {Promise<void>}
    */
-  const currConversationLoading = ref(false)
   const getCurrConversationId = async (userId) => {
     try {
       return await request('/website/tourGroup/createMember', {
@@ -37,13 +37,7 @@ export const useChatsStore = defineStore('chats', () => {
   }
 
   const getChatHistory = async (query) => {
-    try {
-      return await request('/website/tourMessage/getMessageByGroupIdPage', {query})
-    } catch (e) {
-
-    } finally {
-
-    }
+    return await request('/website/tourMessage/getMessageByGroupId', {query})
   }
 
 
@@ -102,6 +96,5 @@ export const useChatsStore = defineStore('chats', () => {
     chatListLoading,
     getChatList,
 
-
   }
 })