From 55382b70b8fe3b2c69459789ff342dbd18922ec0 Mon Sep 17 00:00:00 2001 From: Virgil Clyne Date: Fri, 1 Nov 2024 12:38:01 +0800 Subject: [PATCH] Update request.dev.js --- src/request.dev.js | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/src/request.dev.js b/src/request.dev.js index 3222170..e839985 100644 --- a/src/request.dev.js +++ b/src/request.dev.js @@ -369,21 +369,22 @@ log(`⚠ FORMAT: ${FORMAT}`, ""); switch (infoGroup.type) { case "PGC": if (infoGroup.locales.length !== 0) $request = await availableFetch($request, Settings.Proxies, Settings.Locales, infoGroup.locales); - else ({ request: $request } = await mutiFetch($request, Settings.Proxies, Settings.Locales)); + else ({ request: $request, response: $response } = await mutiFetch($request, Settings.Proxies, Settings.Locales)); break; case "UGC": default: log("⚠ 不是 PGC, 跳过", ""); break; } - switch ( - $platform // 直通模式,不处理,否则无法进http-response - ) { + /* + switch ($platform) { + // 直通模式,不处理,否则无法进http-response case "Shadowrocket": case "Quantumult X": $request.policy = undefined; break; } + */ break; case "/all": // 搜索-全部结果-html(综合) case "/bilibili.polymer.app.search.v1.Search/SearchAll": // 搜索-全部结果-proto(综合) @@ -410,15 +411,12 @@ log(`⚠ FORMAT: ${FORMAT}`, ""); } break; } - if (!$response) { - // 无(构造)回复数据 - switch ($platform) { - // 已有指定策略的请求,根据策略fetch - case "Shadowrocket": - case "Quantumult X": - if ($request.policy) $response = await fetch($request); - break; - } + switch ($platform) { + // 已有指定策略的请求,根据策略fetch + case "Shadowrocket": + case "Quantumult X": + if ($request.policy && !$response) $response = await fetch($request); // 无(构造)回复数据 + break; } break; }