mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2024-11-21 09:36:35 +00:00
feat: support qzone.qq.com Cookies
This commit is contained in:
parent
1a92794d33
commit
f2f6701ebd
@ -3,7 +3,7 @@ import { OB11Constructor } from '../../constructor';
|
|||||||
import { friends, selfInfo } from '@/core/data';
|
import { friends, selfInfo } from '@/core/data';
|
||||||
import BaseAction from '../BaseAction';
|
import BaseAction from '../BaseAction';
|
||||||
import { ActionName } from '../types';
|
import { ActionName } from '../types';
|
||||||
import { NTQQUserApi } from '@/core/apis';
|
import { NTQQUserApi, WebApi } from '@/core/apis';
|
||||||
import { FromSchema, JSONSchema } from 'json-schema-to-ts';
|
import { FromSchema, JSONSchema } from 'json-schema-to-ts';
|
||||||
interface Response {
|
interface Response {
|
||||||
cookies: string
|
cookies: string
|
||||||
@ -22,9 +22,17 @@ export class GetCookies extends BaseAction<Payload, Response> {
|
|||||||
actionName = ActionName.GetCookies;
|
actionName = ActionName.GetCookies;
|
||||||
PayloadSchema = SchemaData;
|
PayloadSchema = SchemaData;
|
||||||
protected async _handle(payload: Payload) {
|
protected async _handle(payload: Payload) {
|
||||||
if (!payload.domain){
|
if (!payload.domain) {
|
||||||
throw new Error('缺少参数 domain');
|
throw new Error('缺少参数 domain');
|
||||||
}
|
}
|
||||||
|
if (payload.domain.endsWith("qzone.qq.com")) {
|
||||||
|
const _Skey = await NTQQUserApi.getSkey() as string;
|
||||||
|
// 兼容整个 *.qzone.qq.com
|
||||||
|
let data = (await NTQQUserApi.getQzoneCookies());
|
||||||
|
const Bkn = WebApi.genBkn(data.p_skey);
|
||||||
|
const CookieValue = 'p_skey=' + data.p_skey + '; skey=' + data.skey + '; p_uin=o' + selfInfo.uin + '; uin=o' + selfInfo.uin;
|
||||||
|
return { cookies: CookieValue };
|
||||||
|
}
|
||||||
const _Skey = await NTQQUserApi.getSkey();
|
const _Skey = await NTQQUserApi.getSkey();
|
||||||
// 取Skey
|
// 取Skey
|
||||||
// 先NodeIKernelTicketService.forceFetchClientKey('')
|
// 先NodeIKernelTicketService.forceFetchClientKey('')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user