This commit is contained in:
abearxiong committed 2025-05-05 00:01:36 +08:00
1 parent d6014b3c40
commit a412c09da0
20 files changed
+2911 -102

No files matched your search

+17
View File
@@ -128,6 +128,23 @@ class XhsClient {
}
return {};
}
/**
*
* @param {*} data
*/
setCookieMap(data = {}) {
const cookieDict = this.getCookieMap();
const newCookieDict = { ...cookieDict, ...data };
const cookieStr = Object.entries(newCookieDict)
.map(([key, value]) => {
const trimmedKey = key.trim();
const trimmedValue = value ? value.trim() : '';
return `${trimmedKey}=${trimmedValue}`;
})
.join('; ');
this.axiosInstance.defaults.headers.Cookie = cookieStr;
this.cookie = cookieStr;
}
/**
* Get X-S and X-T
* @param {*} url
File diff suppressed because it is too large. Load diff