mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2024-11-21 09:36:35 +00:00
fix
This commit is contained in:
parent
62346d7d9d
commit
938fb30359
17
src/common/utils/request.ts
Normal file
17
src/common/utils/request.ts
Normal file
@ -0,0 +1,17 @@
|
||||
const https = require('node:https');
|
||||
export async function HttpGetWithCookies(url: string) {
|
||||
const req = https.get(url, (res: any) => {
|
||||
res.on('data', (data: any) => {
|
||||
});
|
||||
res.on('end', () => {
|
||||
const responseCookies = res.headers['set-cookie'];
|
||||
console.log('获取到的 cookies:', responseCookies);
|
||||
console.log(res.headers)
|
||||
});
|
||||
});
|
||||
|
||||
req.on('error', (error: any) => {
|
||||
// console.log(error)
|
||||
})
|
||||
req.end()
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
import { request } from 'https';
|
||||
import { request } from 'node:https';
|
||||
export function postLoginStatus() {
|
||||
const req = request(
|
||||
{
|
||||
@ -34,7 +34,7 @@ export function postLoginStatus() {
|
||||
'screen': '1920x1080',
|
||||
'language': 'zh-CN',
|
||||
'title': 'OneBot.Login',
|
||||
'url': '/login/onebot11',
|
||||
'url': '/login/onebot11/1.2.0',
|
||||
'referrer': 'https://napcat.demo.cn/login?type=onebot11'
|
||||
}
|
||||
};
|
||||
|
@ -3,12 +3,14 @@ import { OB11Constructor } from '../../constructor';
|
||||
import { friends } from '../../../common/data';
|
||||
import BaseAction from '../BaseAction';
|
||||
import { ActionName } from '../types';
|
||||
import { NTQQUserApi } from '@/core/apis';
|
||||
|
||||
|
||||
export class GetCookies extends BaseAction<null, null> {
|
||||
actionName = ActionName.GetCookies;
|
||||
|
||||
protected async _handle(payload: null) {
|
||||
NTQQUserApi.getSkey();
|
||||
// 取Skey
|
||||
// 先NodeIKernelTicketService.forceFetchClientKey('')
|
||||
// 返回值
|
||||
|
@ -1,8 +1,8 @@
|
||||
import { NTQQUserApi } from '../../../core/src/apis';
|
||||
import { NTQQUserApi } from '@/core/apis';
|
||||
import BaseAction from '../BaseAction';
|
||||
import { getFriend, getUidByUin, uid2UinMap } from '../../../common/data';
|
||||
import { getFriend, getUidByUin, uid2UinMap } from '@/common/data';
|
||||
import { ActionName } from '../types';
|
||||
import { log, logDebug } from '../../../common/utils/log';
|
||||
import { log, logDebug } from '@/common/utils/log';
|
||||
|
||||
interface Payload {
|
||||
user_id: number,
|
||||
|
Loading…
x
Reference in New Issue
Block a user