mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2025-07-19 12:03:37 +00:00
fix
This commit is contained in:
@@ -209,7 +209,8 @@ export function getQQVersionConfigPath(exePath: string = ''): string | undefined
|
|||||||
return configVersionInfoPath;
|
return configVersionInfoPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function calcQQLevel(level: QQLevel) {
|
export function calcQQLevel(level?: QQLevel) {
|
||||||
|
if (!level) return 0;
|
||||||
const { crownNum, sunNum, moonNum, starNum } = level;
|
const { crownNum, sunNum, moonNum, starNum } = level;
|
||||||
return crownNum * 64 + sunNum * 16 + moonNum * 4 + starNum;
|
return crownNum * 64 + sunNum * 16 + moonNum * 4 + starNum;
|
||||||
}
|
}
|
||||||
|
@@ -21,24 +21,24 @@ export default class GoCQHTTPGetStrangerInfo extends BaseAction<Payload, OB11Use
|
|||||||
async _handle(payload: Payload): Promise<OB11User> {
|
async _handle(payload: Payload): Promise<OB11User> {
|
||||||
const user_id = payload.user_id.toString();
|
const user_id = payload.user_id.toString();
|
||||||
const extendData = await this.core.apis.UserApi.getUserDetailInfoByUin(user_id);
|
const extendData = await this.core.apis.UserApi.getUserDetailInfoByUin(user_id);
|
||||||
const uid = (await this.core.apis.UserApi.getUidByUinV2(user_id))!;
|
let uid = (await this.core.apis.UserApi.getUidByUinV2(user_id));
|
||||||
if (!uid || uid.indexOf('*') != -1) {
|
if (!uid) uid = extendData.detail.uid;
|
||||||
|
const info = (await this.core.apis.UserApi.getUserDetailInfo(uid));
|
||||||
|
|
||||||
return {
|
return {
|
||||||
...extendData.detail.simpleInfo.coreInfo,
|
user_id: parseInt(extendData.detail.uin) ?? 0,
|
||||||
...extendData.detail.commonExt,
|
|
||||||
...extendData.detail.simpleInfo.baseInfo,
|
|
||||||
...extendData.detail.simpleInfo.relationFlags,
|
|
||||||
...extendData.detail.simpleInfo.status,
|
|
||||||
user_id: parseInt(extendData.detail.uin) || 0,
|
|
||||||
nickname: extendData.detail.simpleInfo.coreInfo.nick,
|
nickname: extendData.detail.simpleInfo.coreInfo.nick,
|
||||||
sex: OB11UserSex.unknown,
|
age: extendData.detail.simpleInfo.baseInfo.age ?? info.age,
|
||||||
age: extendData.detail.simpleInfo.baseInfo.age || 0,
|
|
||||||
qid: extendData.detail.simpleInfo.baseInfo.qid,
|
qid: extendData.detail.simpleInfo.baseInfo.qid,
|
||||||
level: calcQQLevel(extendData.detail.commonExt?.qqLevel ?? 0) || 0,
|
qqLevel: calcQQLevel(extendData.detail.commonExt?.qqLevel ?? info.qqLevel),
|
||||||
login_days: 0,
|
sex: OB11Entities.sex(extendData.detail.simpleInfo.baseInfo.sex) ?? OB11UserSex.unknown,
|
||||||
|
long_nick: extendData.detail.simpleInfo.baseInfo.longNick ?? info.longNick,
|
||||||
|
reg_time: extendData.detail.commonExt.regTime ?? info.regTime,
|
||||||
|
is_vip: extendData.detail.simpleInfo.vasInfo?.svipFlag,
|
||||||
|
is_years_vip: extendData.detail.simpleInfo.vasInfo?.yearVipFlag,
|
||||||
|
vip_level: extendData.detail.simpleInfo.vasInfo?.vipLevel,
|
||||||
|
remark: extendData.detail.simpleInfo.coreInfo.remark ?? info.remark,
|
||||||
|
status: extendData.detail.simpleInfo.status?.status ?? info.status
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
const data = { ...extendData, ...(await this.core.apis.UserApi.getUserDetailInfo(uid)) };
|
|
||||||
return OB11Entities.stranger(data);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@@ -1,4 +1,5 @@
|
|||||||
export interface OB11User {
|
export interface OB11User {
|
||||||
|
[key: string]: any;
|
||||||
user_id: number;
|
user_id: number;
|
||||||
nickname: string;
|
nickname: string;
|
||||||
remark?: string;
|
remark?: string;
|
||||||
|
Reference in New Issue
Block a user