fix multi session

This commit is contained in:
Archeb
2024-06-22 09:58:13 +08:00
parent 15f6d83e59
commit 44629a0456
3 changed files with 22 additions and 4 deletions
+9 -1
View File
@@ -1,4 +1,12 @@
import cookie from "cookie";
import fs from "fs";
function createDirectoryIfNotExists(dirPath) {
if (!fs.existsSync(dirPath)) {
fs.mkdirSync(dirPath, { recursive: true });
}
}
function extractCookie(cookies) {
var jwtSession = null;
@@ -62,4 +70,4 @@ function sleep(ms) {
return new Promise((resolve) => setTimeout(resolve, ms));
}
export { sleep, extractCookie, getSessionCookie };
export { createDirectoryIfNotExists, sleep, extractCookie, getSessionCookie };