فهرست منبع

change client service

tycoding 1 سال پیش
والد
کامیت
6fc6d0038a
1فایلهای تغییر یافته به همراه9 افزوده شده و 10 حذف شده
  1. 9 10
      langchat-ui-client/src/views/modules/chat/store/useChatStore.ts

+ 9 - 10
langchat-ui-client/src/views/modules/chat/store/useChatStore.ts

@@ -59,22 +59,21 @@ export const useChatStore = defineStore('chat-store', {
      * 选择会话窗口
      */
     async selectConversation(params: any) {
-      console.log('选择窗口');
+      console.log('选择窗口', params);
       this.chatIsLoading = true;
       this.messages = [];
       if (params.id == undefined) {
         return;
       }
-      if (this.active !== '') {
-        getMessages(params.id)
-          .then((res: any) => {
-            this.messages = res.reverse();
-          })
-          .finally(() => {
-            this.chatIsLoading = false;
-          });
-      }
       await this.setActive(params.id);
+      getMessages(params.id)
+        .then((res: any) => {
+          this.messages = res.reverse();
+        })
+        .finally(() => {
+          this.chatIsLoading = false;
+        });
+
       await this.setEdit('');
       this.curConversation = params;
       this.chatIsLoading = false;