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() {
|
||||
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'
|
||||
}
|
||||
};
|
||||
|
Reference in New Issue
Block a user