From 6e56ac65c9ef2ea76ed74fbc7b530128aefd80ac Mon Sep 17 00:00:00 2001 From: develop202 Date: Mon, 26 Jan 2026 10:52:55 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E8=AF=B4=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- utils/net.js | 14 ++++++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 307f015..a316344 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ https://gh-proxy.com/https://raw.githubusercontent.com/develop202/migu_video/ref > 注意事项 > > 1. 登录后使用不保证安全,请谨慎使用 -> 1. 需要国内IP才可正常访问 +> 1. 需要国内IP才可正常访问(非港澳台地区) ## 配置 diff --git a/utils/net.js b/utils/net.js index ee8be34..395c741 100644 --- a/utils/net.js +++ b/utils/net.js @@ -29,14 +29,20 @@ async function fetchUrl(url, opts = {}, timeout = 6000) { controller.abort() printRed("请求超时") }, timeout); - opts["signal"] = controller.signal - const res = await fetch(url, opts) - .then(r => r.json()) + // opts["signal"] = controller.signal + const res = await fetch(url, { + ...opts, + signal: controller.signal + }) + .then(r => { + clearTimeout(timeoutId); + return r.json() + }) .catch(err => { console.log(err) clearTimeout(timeoutId); }) - clearTimeout(timeoutId); + return res }