更新说明
This commit is contained in:
@@ -26,7 +26,7 @@ https://gh-proxy.com/https://raw.githubusercontent.com/develop202/migu_video/ref
|
||||
> 注意事项
|
||||
>
|
||||
> 1. 登录后使用不保证安全,请谨慎使用
|
||||
> 1. 需要国内IP才可正常访问
|
||||
> 1. 需要国内IP才可正常访问(非港澳台地区)
|
||||
|
||||
## 配置
|
||||
|
||||
|
||||
14
utils/net.js
14
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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user