ソースを参照

修改智能体详细页面新增topic时,返回topicId

余思翰 3日前
コミット
6cf3fcdb3c

+ 2
- 1
llm-back/ruoyi-llm/src/main/java/com/ruoyi/web/llm/controller/CmcTopicController.java ファイルの表示

@@ -75,7 +75,8 @@ public class CmcTopicController extends BaseController
75 75
     public AjaxResult add(@RequestBody CmcTopic cmcTopic)
76 76
     {
77 77
         cmcTopic.setTopicId(new SnowFlake().generateId());
78
-        return toAjax(cmcTopicService.insertCmcTopic(cmcTopic));
78
+        cmcTopicService.insertCmcTopic(cmcTopic);
79
+        return success(cmcTopic.getTopicId());
79 80
     }
80 81
 
81 82
     /**

+ 4
- 7
llm-ui/src/views/llm/agent/AgentDetail.vue ファイルの表示

@@ -2,7 +2,7 @@
2 2
  * @Author: wrh
3 3
  * @Date: 2025-01-01 00:00:00
4 4
  * @LastEditors: Please set LastEditors
5
- * @LastEditTime: 2025-07-29 15:42:41
5
+ * @LastEditTime: 2025-07-29 16:58:28
6 6
 -->
7 7
 <template>
8 8
   <div class="agent-detail-container" v-loading="loading">
@@ -425,12 +425,9 @@ const submitChatUpload = async () => {
425 425
     }
426 426
     chatMessages.value.push(uploadMessage);
427 427
     ElMessage.success('文件上传成功');
428
-    await addTopic({ agentId: props.agentId, topic: fileName })
429
-    const res = await listTopic({ agentId: props.agentId })
430
-    if (res.rows.length > 0) {
431
-      const topicId = res.rows[0].topicId
432
-      await addChat({ userId: userStore.id, chatId, topicId, output: assistantContent, outputTime: proxy.parseTime(new Date(), '{y}-{m}-{d} {h}:{i}:{s}') })
433
-    }
428
+    let topicRes = await addTopic({ agentId: props.agentId, topic: fileName });
429
+    const topicId = topicRes.msg;
430
+    await addChat({ userId: userStore.id, chatId, topicId, output: assistantContent, outputTime: proxy.parseTime(new Date(), '{y}-{m}-{d} {h}:{i}:{s}') });
434 431
 
435 432
     nextTick(() => {
436 433
       scrollToBottom()

読み込み中…
キャンセル
保存