添加vivid

This commit is contained in:
develop202
2025-12-22 14:00:25 +08:00
parent 2a4c9435a1
commit c0ce28f776
11 changed files with 7549 additions and 6454 deletions

View File

@@ -1,5 +1,8 @@
import os from "os"
// const controller = new AbortController();
// const timeoutId = setTimeout(() => controller.abort(), 15000);
function getLocalIPv(ver = 4) {
const ips = []
const inter = os.networkInterfaces()
@@ -22,6 +25,15 @@ function getLocalIPv(ver = 4) {
return ips
}
export {
getLocalIPv
async function fetchUrl(url, opts = {}) {
// opts["signal"] = controller.signal
const res = await fetch(url, opts)
.then(r => r.json())
.catch(err => console.log(err))
// clearTimeout(timeoutId);
return res
}
export {
getLocalIPv, fetchUrl
}