更新说明

This commit is contained in:
develop202
2026-01-26 10:52:55 +08:00
parent 1a02333e4c
commit 6e56ac65c9
2 changed files with 11 additions and 5 deletions

View File

@@ -26,7 +26,7 @@ https://gh-proxy.com/https://raw.githubusercontent.com/develop202/migu_video/ref
> 注意事项 > 注意事项
> >
> 1. 登录后使用不保证安全,请谨慎使用 > 1. 登录后使用不保证安全,请谨慎使用
> 1. 需要国内IP才可正常访问 > 1. 需要国内IP才可正常访问(非港澳台地区)
## 配置 ## 配置

View File

@@ -29,14 +29,20 @@ async function fetchUrl(url, opts = {}, timeout = 6000) {
controller.abort() controller.abort()
printRed("请求超时") printRed("请求超时")
}, timeout); }, timeout);
opts["signal"] = controller.signal // opts["signal"] = controller.signal
const res = await fetch(url, opts) const res = await fetch(url, {
.then(r => r.json()) ...opts,
signal: controller.signal
})
.then(r => {
clearTimeout(timeoutId);
return r.json()
})
.catch(err => { .catch(err => {
console.log(err) console.log(err)
clearTimeout(timeoutId); clearTimeout(timeoutId);
}) })
clearTimeout(timeoutId);
return res return res
} }