diff --git a/src/onebot/action/user/GetCookies.ts b/src/onebot/action/user/GetCookies.ts index 621e8dac4..147b49dbf 100644 --- a/src/onebot/action/user/GetCookies.ts +++ b/src/onebot/action/user/GetCookies.ts @@ -67,7 +67,7 @@ export class GetCookies extends BaseAction { const cookiesObject = await NTQQUserApi.getCookies(payload.domain); //把获取到的cookiesObject转换成 k=v; 格式字符串拼接在一起 const cookies = Object.entries(cookiesObject).map(([key, value]) => `${key}=${value}`).join('; '); - const bkn = NTQQWebApi.getBknFromCookie(cookiesObject); + const bkn = cookiesObject?.skey ? NTQQWebApi.getBknFromCookie(cookiesObject) : ''; return { cookies, bkn }; } }