From 581f9b7bd3c0185cb26ee1ae912334d9b678ead0 Mon Sep 17 00:00:00 2001 From: Soulter <37870767+Soulter@users.noreply.github.com> Date: Tue, 10 Jun 2025 13:02:30 +0800 Subject: [PATCH] fix: typo fix Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com> --- astrbot/dashboard/routes/chat.py | 2 +- dashboard/src/views/ChatPage.vue | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/astrbot/dashboard/routes/chat.py b/astrbot/dashboard/routes/chat.py index 24627a6e9..270c92b44 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 5368a6668..0171e3e7a 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; })