mirror of
https://github.com/LLOneBot/LLOneBot.git
synced 2024-11-22 01:56:33 +00:00
Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
b4fc987537 | ||
![]() |
d0ccf53d88 | ||
![]() |
d5ca94569d |
@@ -4,7 +4,7 @@
|
|||||||
"name": "LLOneBot",
|
"name": "LLOneBot",
|
||||||
"slug": "LLOneBot",
|
"slug": "LLOneBot",
|
||||||
"description": "实现 OneBot 11 协议,用于 QQ 机器人开发",
|
"description": "实现 OneBot 11 协议,用于 QQ 机器人开发",
|
||||||
"version": "3.30.2",
|
"version": "3.30.3",
|
||||||
"icon": "./icon.webp",
|
"icon": "./icon.webp",
|
||||||
"authors": [
|
"authors": [
|
||||||
{
|
{
|
||||||
|
@@ -197,7 +197,7 @@ export class WebApi {
|
|||||||
let res = '';
|
let res = '';
|
||||||
let resJson;
|
let resJson;
|
||||||
try {
|
try {
|
||||||
res = await RequestUtil.HttpGetText(url, 'GET', '', { 'Cookie': CookieValue });
|
res = await RequestUtil.HttpGetText(url, 'GET', '', { 'Cookie': cookieStr });
|
||||||
const match = res.match(/window\.__INITIAL_STATE__=(.*?);/);
|
const match = res.match(/window\.__INITIAL_STATE__=(.*?);/);
|
||||||
if (match) {
|
if (match) {
|
||||||
resJson = JSON.parse(match[1].trim());
|
resJson = JSON.parse(match[1].trim());
|
||||||
@@ -214,7 +214,8 @@ export class WebApi {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let HonorInfo: any = { group_id: groupCode };
|
let HonorInfo: any = { group_id: groupCode };
|
||||||
const CookieValue = (await NTQQUserApi.getCookies('qun.qq.com')).cookies;
|
const cookieObject = await NTQQUserApi.getCookies('qun.qq.com')
|
||||||
|
const cookieStr = Object.entries(cookieObject).map(([key, value]) => `${key}=${value}`).join('; ')
|
||||||
|
|
||||||
if (getType === WebHonorType.TALKACTIVE || getType === WebHonorType.ALL) {
|
if (getType === WebHonorType.TALKACTIVE || getType === WebHonorType.ALL) {
|
||||||
try {
|
try {
|
||||||
|
@@ -15,10 +15,13 @@ export class GetCookies extends BaseAction<Payload, Response> {
|
|||||||
actionName = ActionName.GetCookies
|
actionName = ActionName.GetCookies
|
||||||
|
|
||||||
protected async _handle(payload: Payload) {
|
protected async _handle(payload: Payload) {
|
||||||
|
if (!payload.domain) {
|
||||||
|
throw '缺少参数 domain'
|
||||||
|
}
|
||||||
const cookiesObject = await NTQQUserApi.getCookies(payload.domain)
|
const cookiesObject = await NTQQUserApi.getCookies(payload.domain)
|
||||||
//把获取到的cookiesObject转换成 k=v; 格式字符串拼接在一起
|
//把获取到的cookiesObject转换成 k=v; 格式字符串拼接在一起
|
||||||
const cookies = Object.entries(cookiesObject).map(([key, value]) => `${key}=${value}`).join('; ')
|
const cookies = Object.entries(cookiesObject).map(([key, value]) => `${key}=${value}`).join('; ')
|
||||||
const bkn = WebApi.genBkn(cookiesObject.p_skey)
|
const bkn = cookiesObject.skey ? WebApi.genBkn(cookiesObject.skey) : ''
|
||||||
return { cookies, bkn }
|
return { cookies, bkn }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1 +1 @@
|
|||||||
export const version = '3.30.2'
|
export const version = '3.30.3'
|
||||||
|
Reference in New Issue
Block a user