yz-yuki-plugin 2.0.9-4 → 2.0.9-5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -174,6 +174,13 @@ class BiliRiskCookie {
|
|
|
174
174
|
if (data?.code === 0) {
|
|
175
175
|
if (data?.data?.code === 0) {
|
|
176
176
|
// 登录成功,获取 set-cookie header 并写入 Jar
|
|
177
|
+
// 手动提取并设置 cookie,兼容某些环境下 axios-cookiejar-support 可能未正确处理 set-cookie 的情况
|
|
178
|
+
const setCookieHeaders = response.headers['set-cookie'];
|
|
179
|
+
if (setCookieHeaders) {
|
|
180
|
+
for (const cookieStr of setCookieHeaders) {
|
|
181
|
+
await jar.setCookie(cookieStr, 'https://passport.bilibili.com');
|
|
182
|
+
}
|
|
183
|
+
}
|
|
177
184
|
const SESSDATA_expires = await this.getCookieExpiration(jar, 'SESSDATA', 'https://passport.bilibili.com');
|
|
178
185
|
try {
|
|
179
186
|
if (SESSDATA_expires != null) {
|