From 7a08187c5f85d885781f471add003fb03cae1350 Mon Sep 17 00:00:00 2001 From: Alen Date: Tue, 20 Aug 2024 07:28:25 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20Uid=E8=BD=ACUin?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复Uid转Uin兜底逻辑 --- src/core/apis/user.ts | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/core/apis/user.ts b/src/core/apis/user.ts index bf09fd77..ab231863 100644 --- a/src/core/apis/user.ts +++ b/src/core/apis/user.ts @@ -127,13 +127,16 @@ export class NTQQUserApi { return RetUser; } - async getUserDetailInfo(uid: string) { - const ret = await this.fetchUserDetailInfo(uid, UserDetailSource.KDB); - if (ret.uin === '0') { - this.context.logger.logDebug('[NapCat] [Mark] getUserDetailInfo Mode1 Failed.') - return await this.fetchUserDetailInfo(uid, UserDetailSource.KSERVER); + async getUserDetailInfo(uid: string): Promise { + try { + let retUser = await this.fetchUserDetailInfo(uid, UserDetailSource.KDB); + if (retUser.uin !== '0') { + return retUser; + } + } catch (e) { } - return ret; + this.context.logger.logDebug('[NapCat] [Mark] getUserDetailInfo Mode1 Failed.'); + return this.fetchUserDetailInfo(uid, UserDetailSource.KSERVER); } async modifySelfProfile(param: ModifyProfileParams) {