feat: shareDigest

This commit is contained in:
手瓜一十雪
2024-08-04 19:11:44 +08:00
parent 1e794bd6a1
commit 5fa39a6091
4 changed files with 22 additions and 5 deletions

View File

@@ -210,6 +210,7 @@ export class NTQQUserApi {
return false;
})
static async getUidByUin(Uin: string) {
//此代码仅临时使用,后期会被废弃
if (!requireMinNTQQBuild('26702')) {
return await NTQQUserApi.getUidByUinV2(Uin);
}
@@ -223,6 +224,7 @@ export class NTQQUserApi {
return false;
})
static async getUinByUid(Uid: string) {
//此代码仅临时使用,后期会被废弃
if (!requireMinNTQQBuild('26702')) {
return await NTQQUserApi.getUinByUidV2(Uid);
}

View File

@@ -114,6 +114,22 @@ export interface GroupEssenceMsgRet {
}
}
export class WebApi {
static async shareDigest(groupCode: string, msgSeq: string, msgRandom: string, targetGroupCode: string) {
const CookiesObject = await NTQQUserApi.getCookies('qun.qq.com');
const CookieValue = Object.entries(CookiesObject).map(([key, value]) => `${key}=${value}`).join('; ');
const Bkn = WebApi.genBkn(CookiesObject.skey);
let ret: any = undefined;
const data = 'group_code=' + groupCode + '&msg_seq=' + msgSeq + '&msg_random=' + msgRandom + '&target_group_code=' + targetGroupCode;
const url = 'https://qun.qq.com/cgi-bin/group_digest/share_digest?bkn=' + Bkn + "&" + data;
//console.log(url);
try {
ret = await RequestUtil.HttpGetText(url, 'GET', '', { 'Cookie': CookieValue });
return ret;
} catch (e) {
return undefined;
}
return undefined;
}
@CacheClassFuncAsync(3600 * 1000, 'webapi_get_group_members')
static async getGroupEssenceMsg(GroupCode: string, page_start: string) {
const CookiesObject = await NTQQUserApi.getCookies('qun.qq.com');

View File

@@ -9,10 +9,6 @@ import {
import { GeneralCallResult } from '@/core/services/common';
export interface NodeIKernelGroupService {
getUidByUin(uin: string): Promise<string>;
getUinByUid(uid: string): Promise<string>;
//26702
getGroupMemberLevelInfo(groupCode: string): Promise<unknown>;
//26702