Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Update sudojia_sspanel.js
- 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
  • Loading branch information
atishoo authored May 8, 2025
commit 2066b934ed49a82190f07dae0115c40aab458936
7 changes: 4 additions & 3 deletions src/web/sudojia_sspanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 () => {
Expand Down Expand Up @@ -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}`);
}
}

Expand All @@ -112,4 +113,4 @@ async function checkin(url) {
} catch (e) {
console.error(`签到时发生异常:${e}`);
}
}
}