master
刘东琪 9 months ago
parent 4766e1b5b2
commit 2e4b5261da
  1. 9
      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

Loading…
Cancel
Save