diff --git a/astrbot/dashboard/routes/chat.py b/astrbot/dashboard/routes/chat.py index 24627a6e..270c92b4 100644 --- a/astrbot/dashboard/routes/chat.py +++ b/astrbot/dashboard/routes/chat.py @@ -258,7 +258,7 @@ class ChatRoute(Route): username = g.get("username", "guest") post_data = await request.json if "conversation_id" not in post_data or "title" not in post_data: - return Response().error("Missing key: conversation_id or titke").__dict__ + return Response().error("Missing key: conversation_id or title").__dict__ conversation_id = post_data["conversation_id"] title = post_data["title"] diff --git a/dashboard/src/views/ChatPage.vue b/dashboard/src/views/ChatPage.vue index 5368a666..0171e3e7 100644 --- a/dashboard/src/views/ChatPage.vue +++ b/dashboard/src/views/ChatPage.vue @@ -308,15 +308,16 @@ export default { saveTitle() { if (!this.editingCid) return; + const trimmedTitle = this.editingTitle.trim(); axios.post('/api/chat/rename_conversation', { conversation_id: this.editingCid, - title: this.editingTitle + title: trimmedTitle }) .then(response => { // 更新本地对话列表中的标题 const conversation = this.conversations.find(c => c.cid === this.editingCid); if (conversation) { - conversation.title = this.editingTitle; + conversation.title = trimmedTitle; } this.editTitleDialog = false; })