feat: forward single msg

feat: statistic sent receive msg count by api get_status
This commit is contained in:
linyuchen
2024-05-03 00:59:07 +08:00
parent 3e4eb926f9
commit 8bff46f466
7 changed files with 74 additions and 8 deletions

View File

@@ -8,13 +8,15 @@ interface Payload {
domain: string
}
interface Response {
Pskey: object;
Skey: string;
cookies: string
}
export class GetCookies extends BaseAction<Payload, Response> {
actionName = ActionName.GetCookies;
protected async _handle(payload: Payload) {
if (!payload.domain){
throw new Error('缺少参数 domain');
}
const _Skey = await NTQQUserApi.getSkey();
// 取Skey
// 先NodeIKernelTicketService.forceFetchClientKey('')
@@ -29,7 +31,7 @@ export class GetCookies extends BaseAction<Payload, Response> {
// }
// request https://ssl.ptlogin2.qq.com/jump?ptlang=1033&clientuin=1627126029&clientkey=key
// &u1=https%3A%2F%2Fh5.qzone.qq.com%2Fqqnt%2Fqzoneinpcqq%2Ffriend%3Frefresh%3D0%26clientuin%3D0%26darkMode%3D0&keyindex=keyIndex
const _PSkey = await NTQQUserApi.getPSkey([payload.domain]);
const _PSkey = (await NTQQUserApi.getPSkey([payload.domain]))[payload.domain];
// 取Pskey
// NodeIKernelTipOffService.getPskey([ 'qun.qq.com' ], true )
// {
@@ -42,6 +44,9 @@ export class GetCookies extends BaseAction<Payload, Response> {
if (!_PSkey || !_Skey) {
throw new Error('获取Cookies失败');
}
return { Pskey: _PSkey, Skey: _Skey };
const cookies = `pskey=${_PSkey}; skey=${_Skey}`;
return {
cookies
};
}
}