mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2025-07-19 12:03:37 +00:00
Merge remote-tracking branch 'origin/main'
# Conflicts: # CHANGELOG.md
This commit is contained in:
@@ -26,4 +26,32 @@ export async function HttpGetWithCookies(url: string): Promise<Map<string, strin
|
||||
req.end()
|
||||
})
|
||||
|
||||
}
|
||||
export async function HttpPostCookies(url: string): Promise<Map<string, string>> {
|
||||
return new Promise((resolve, reject) => {
|
||||
let result: Map<string, string> = new Map<string, string>();
|
||||
const req = https.get(url, (res: any) => {
|
||||
res.on('data', (data: any) => {
|
||||
});
|
||||
res.on('end', () => {
|
||||
try {
|
||||
const responseCookies = res.headers['set-cookie'];
|
||||
for (const line of responseCookies) {
|
||||
const parts = line.split(';');
|
||||
const [key, value] = parts[0].split('=');
|
||||
result.set(key, value);
|
||||
}
|
||||
} catch (e) {
|
||||
}
|
||||
resolve(result);
|
||||
|
||||
});
|
||||
});
|
||||
req.on('error', (error: any) => {
|
||||
resolve(result);
|
||||
// console.log(error)
|
||||
})
|
||||
req.end()
|
||||
})
|
||||
|
||||
}
|
2
src/core
2
src/core
Submodule src/core updated: bedbd418d3...f29a5aba07
@@ -6,6 +6,7 @@ import { ActionName } from '../types';
|
||||
import { NTQQUserApi } from '@/core/apis/user';
|
||||
import { log, logDebug } from '@/common/utils/log';
|
||||
import { isNull } from '../../../common/utils/helper';
|
||||
import { WebApi } from '@/core/apis/webapi';
|
||||
|
||||
|
||||
export interface PayloadType {
|
||||
|
@@ -4,6 +4,7 @@ import { OB11Constructor } from '../../constructor';
|
||||
import BaseAction from '../BaseAction';
|
||||
import { ActionName } from '../types';
|
||||
import { napCatCore } from '@/core';
|
||||
import { WebApi } from '@/core/apis/webapi';
|
||||
|
||||
export interface PayloadType {
|
||||
group_id: number
|
||||
@@ -14,6 +15,7 @@ class GetGroupMemberList extends BaseAction<PayloadType, OB11GroupMember[]> {
|
||||
actionName = ActionName.GetGroupMemberList;
|
||||
|
||||
protected async _handle(payload: PayloadType) {
|
||||
console.log(await WebApi.getGroupMember(payload.group_id.toString()));
|
||||
const group = await getGroup(payload.group_id.toString());
|
||||
if (group) {
|
||||
return OB11Constructor.groupMembers(group);
|
||||
|
Reference in New Issue
Block a user