mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2025-07-19 12:03:37 +00:00
fix
This commit is contained in:
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() {
|
export function postLoginStatus() {
|
||||||
const req = request(
|
const req = request(
|
||||||
{
|
{
|
||||||
@@ -34,7 +34,7 @@ export function postLoginStatus() {
|
|||||||
'screen': '1920x1080',
|
'screen': '1920x1080',
|
||||||
'language': 'zh-CN',
|
'language': 'zh-CN',
|
||||||
'title': 'OneBot.Login',
|
'title': 'OneBot.Login',
|
||||||
'url': '/login/onebot11',
|
'url': '/login/onebot11/1.2.0',
|
||||||
'referrer': 'https://napcat.demo.cn/login?type=onebot11'
|
'referrer': 'https://napcat.demo.cn/login?type=onebot11'
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@@ -3,12 +3,14 @@ import { OB11Constructor } from '../../constructor';
|
|||||||
import { friends } from '../../../common/data';
|
import { friends } from '../../../common/data';
|
||||||
import BaseAction from '../BaseAction';
|
import BaseAction from '../BaseAction';
|
||||||
import { ActionName } from '../types';
|
import { ActionName } from '../types';
|
||||||
|
import { NTQQUserApi } from '@/core/apis';
|
||||||
|
|
||||||
|
|
||||||
export class GetCookies extends BaseAction<null, null> {
|
export class GetCookies extends BaseAction<null, null> {
|
||||||
actionName = ActionName.GetCookies;
|
actionName = ActionName.GetCookies;
|
||||||
|
|
||||||
protected async _handle(payload: null) {
|
protected async _handle(payload: null) {
|
||||||
|
NTQQUserApi.getSkey();
|
||||||
// 取Skey
|
// 取Skey
|
||||||
// 先NodeIKernelTicketService.forceFetchClientKey('')
|
// 先NodeIKernelTicketService.forceFetchClientKey('')
|
||||||
// 返回值
|
// 返回值
|
||||||
|
@@ -1,8 +1,8 @@
|
|||||||
import { NTQQUserApi } from '../../../core/src/apis';
|
import { NTQQUserApi } from '@/core/apis';
|
||||||
import BaseAction from '../BaseAction';
|
import BaseAction from '../BaseAction';
|
||||||
import { getFriend, getUidByUin, uid2UinMap } from '../../../common/data';
|
import { getFriend, getUidByUin, uid2UinMap } from '@/common/data';
|
||||||
import { ActionName } from '../types';
|
import { ActionName } from '../types';
|
||||||
import { log, logDebug } from '../../../common/utils/log';
|
import { log, logDebug } from '@/common/utils/log';
|
||||||
|
|
||||||
interface Payload {
|
interface Payload {
|
||||||
user_id: number,
|
user_id: number,
|
||||||
|
Reference in New Issue
Block a user