From 13a8a65a018ce65260a5934eae60d2f034bffd0c Mon Sep 17 00:00:00 2001 From: atishoo <467237923@qq.com> Date: Thu, 8 May 2025 15:55:07 +0800 Subject: [PATCH] Update sudojia_sspanel.js (#1) - update Accept-Encoding: remove br and zstd comporess arithmetic,because some server will return a json string with special prefix string - log errors detail - reset cookie before start a new request --- src/web/sudojia_sspanel.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/web/sudojia_sspanel.js b/src/web/sudojia_sspanel.js index c129f441..d51597b8 100644 --- a/src/web/sudojia_sspanel.js +++ b/src/web/sudojia_sspanel.js @@ -26,7 +26,7 @@ const headers = { "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8", "User-Agent": sudojia.getRandomUserAgent('PC'), 'Accept': 'application/json, text/javascript, */*; q=0.01', - 'Accept-Encoding': 'gzip, deflate, br, zstd', + 'Accept-Encoding': 'gzip, deflate', }; !(async () => { @@ -84,8 +84,9 @@ async function login(url, email, pwd) { console.log('登录成功~'); await $.wait(sudojia.getRandomWait(800, 1200)); await checkin(url); + delete headers.Cookie; } catch (e) { - console.error(`登录时发生异常:${e}`); + console.error(`登录时发生异常:${e.errors}`); } } @@ -112,4 +113,4 @@ async function checkin(url) { } catch (e) { console.error(`签到时发生异常:${e}`); } -} \ No newline at end of file +}