上传文件至「Scripts」

This commit is contained in:
2026-04-30 12:51:45 +09:00
parent ff1f12e646
commit 92405dcf66

View File

@@ -382,7 +382,13 @@ function ObjectKeys2LowerCase(obj) {
/* ====================== 入口 ====================== */ /* ====================== 入口 ====================== */
!(async () => { !(async () => {
try { try {
if (typeof $request !== "undefined") { // 判断运行模式:
// - http-response 脚本:$response 存在(含 body→ 抓 cookie
// - cron / 手动执行 / Node.js$response 不存在 → 签到
// 不能用 $request 判断,因为某些 Surge 版本在 cron 里也会注入 $request
const isMitmMode =
typeof $response !== "undefined" && $response && $response.body;
if (isMitmMode) {
await getCookie(); await getCookie();
} else { } else {
await checkEnv(); await checkEnv();