From 7c7e641d1fc07dc49f05b5bfeb18fbb0dd8e0b14 Mon Sep 17 00:00:00 2001 From: CrescentLeaf Date: Wed, 8 Oct 2025 00:54:46 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E9=81=97=E6=BC=8F=E7=9A=84=20return?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/api/ChatApi.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/server/api/ChatApi.ts b/server/api/ChatApi.ts index 83e98e7..c2a1751 100644 --- a/server/api/ChatApi.ts +++ b/server/api/ChatApi.ts @@ -267,7 +267,10 @@ export default class ChatApi extends BaseApi { const user = User.findById(token.author) as User const haveId = args.id && (args.id as string) != '' - if (haveId && Chat.findById(args.id as string) != null) return + if (haveId && Chat.findById(args.id as string) != null) return { + msg: "对话 ID 已被占用", + code: 403, + } const chat = ChatGroup.createGroup(haveId ? undefined : args.id as string) chat.setTitle(args.title as string)