From 48bd8846900d1451ed99d85f1ae31d43deb0d280 Mon Sep 17 00:00:00 2001 From: CrescentLeaf Date: Sat, 6 Dec 2025 16:53:35 +0800 Subject: [PATCH] =?UTF-8?q?fix(cp):=20=E9=94=99=E8=AF=AF=E7=9A=84=E6=B3=A8?= =?UTF-8?q?=E5=86=8C=E6=96=B9=E6=B3=95=E8=BF=94=E5=9B=9E=E5=80=BC=20*=20?= =?UTF-8?q?=E4=B8=8D=E6=98=AF,=20=E6=88=91=E7=94=A8=E6=88=B7=20ID=20?= =?UTF-8?q?=E5=91=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client-protocol/LingChairClient.ts | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/client-protocol/LingChairClient.ts b/client-protocol/LingChairClient.ts index 5471f1e..349459c 100644 --- a/client-protocol/LingChairClient.ts +++ b/client-protocol/LingChairClient.ts @@ -180,18 +180,6 @@ export default class LingChairClient { else throw new CallbackError(re) } - async register(args: { - nickname: string, - username?: string, - password: string, - }) { - try { - await this.registerOrThrow(args) - return true - } catch (_) { - return false - } - } getBaseHttpUrl() { const url = new URL(this.server_url) return (({ @@ -204,6 +192,17 @@ export default class LingChairClient { getUrlForFileByHash(file_hash?: string, defaultUrl?: string) { return file_hash ? (this.getBaseHttpUrl() + '/uploaded_files/' + file_hash) : defaultUrl } + async register(args: { + nickname: string, + username?: string, + password: string, + }) { + try { + return await this.registerOrThrow(args) + } catch (_) { + return null + } + } async registerOrThrow({ nickname, username, @@ -220,6 +219,7 @@ export default class LingChairClient { }) if (re.code != 200) throw new CallbackError(re) + return re.data!.user_id as string } async uploadFile({ chatId,