From 2e4b5261daaf205ec9d2858d0b0cb3a4ee6337fd Mon Sep 17 00:00:00 2001 From: liudongqi Date: Wed, 4 Sep 2024 15:52:44 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- routes/index.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/routes/index.js b/routes/index.js index 1cf2306..cc7a68c 100644 --- a/routes/index.js +++ b/routes/index.js @@ -11,7 +11,7 @@ let store = new Store(); router.post('/rsCookie', async (req, res) => { - let uuid = crypto.randomUUID() + let uuid = crypto.randomUUID().replace(/-/g, ""); let start = new Date(); try { let url = req.body['url']; @@ -45,9 +45,10 @@ router.post('/rsCookie', async (req, res) => { Buffer.from(htmlStr, 'base64').toString('utf-8'), jsText, cookie != null && cookie !== "" ? Buffer.from(cookie, 'base64').toString('utf-8') : null, - userAgent != null && userAgent !== "" ? Buffer.from(userAgent, 'base64').toString('utf-8') : null) + userAgent != null && userAgent !== "" ? Buffer.from(userAgent, 'base64').toString('utf-8') : null, + uuid) - console.log(`${uuid};返回cookie ---->`,cookies.split('; ')) + console.log(`${uuid};返回cookie ---->`, cookies.split('; ')) res.status(200).send(cookies); } catch (e) { @@ -85,7 +86,7 @@ function CookieStr2List(cookies) { return list } -async function handle(url, htmlStr, jsText, cookie, userAgent,uuid) { +async function handle(url, htmlStr, jsText, cookie, userAgent, uuid) { // 获取 origin let baseUrl = new URL(url).origin; // 初始化 jsDom 和 cookieJar