Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
MliKiowa committed Apr 27, 2024
1 parent 62346d7 commit 938fb30
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 5 deletions.
17 changes: 17 additions & 0 deletions src/common/utils/request.ts
Original file line number Diff line number Diff line change
@@ -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()
}
4 changes: 2 additions & 2 deletions src/common/utils/umami.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { request } from 'https';
import { request } from 'node:https';
export function postLoginStatus() {
const req = request(
{
Expand Down Expand Up @@ -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'
}
};
Expand Down
2 changes: 2 additions & 0 deletions src/onebot11/action/user/GetCookies.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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('')
// 返回值
Expand Down
6 changes: 3 additions & 3 deletions src/onebot11/action/user/SendLike.ts
Original file line number Diff line number Diff line change
@@ -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,
Expand Down

0 comments on commit 938fb30

Please sign in to comment.