From 2d4f0635af978b9b2871f868045d010c680df6ef Mon Sep 17 00:00:00 2001 From: jason5ng32 Date: Thu, 12 Sep 2024 18:31:52 +0800 Subject: [PATCH] Improvements --- frontend/utils/getips/cloudflare-v6.js | 1 + frontend/utils/getips/index.js | 5 +---- frontend/utils/getips/ipipnet.js | 5 ++--- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/frontend/utils/getips/cloudflare-v6.js b/frontend/utils/getips/cloudflare-v6.js index 0da118d8..fd1532ea 100644 --- a/frontend/utils/getips/cloudflare-v6.js +++ b/frontend/utils/getips/cloudflare-v6.js @@ -25,6 +25,7 @@ const getIPFromCloudflare_V6 = async () => { }; } } catch (error) { + console.error("Error fetching IP from Cloudflare:", error); return { ip: null, source: "Cloudflare IPv6" diff --git a/frontend/utils/getips/index.js b/frontend/utils/getips/index.js index d24c3036..f5b30f77 100644 --- a/frontend/utils/getips/index.js +++ b/frontend/utils/getips/index.js @@ -1,11 +1,8 @@ import { getIPFromIPIP } from "./ipipnet"; -import { getIPFromQQ } from "./qq"; -import { getIPFromUpai } from "./upai"; -import { getIPFromCloudflare_CN } from "./cloudflare-cn"; import { getIPFromCloudflare_V4 } from "./cloudflare-v4"; import { getIPFromCloudflare_V6 } from "./cloudflare-v6"; import { getIPFromIPChecking64 } from "./ipchecking64"; import { getIPFromIPChecking4 } from "./ipchecking4"; import { getIPFromIPChecking6 } from "./ipchecking6"; -export { getIPFromIPIP, getIPFromQQ, getIPFromUpai, getIPFromCloudflare_CN, getIPFromCloudflare_V4, getIPFromCloudflare_V6, getIPFromIPChecking64, getIPFromIPChecking4, getIPFromIPChecking6}; \ No newline at end of file +export { getIPFromIPIP, getIPFromCloudflare_V4, getIPFromCloudflare_V6, getIPFromIPChecking64, getIPFromIPChecking4, getIPFromIPChecking6}; \ No newline at end of file diff --git a/frontend/utils/getips/ipipnet.js b/frontend/utils/getips/ipipnet.js index 0c56bcbd..9df4ac80 100644 --- a/frontend/utils/getips/ipipnet.js +++ b/frontend/utils/getips/ipipnet.js @@ -1,5 +1,4 @@ -// import { getIPFromQQ } from "./qqvideo"; -import { getIPFromAliCDN } from "./alicdn"; +import { getIPFromUpai } from "./upai"; import { isValidIP } from '@/utils/valid-ip.js'; // 从 IPIP.net 获取 IP 地址 @@ -21,7 +20,7 @@ const getIPFromIPIP = async () => { console.error("Error fetching IP from IPIP.net:", error); } // 故障时尝试从 AliCDN 获取 IP 地址 - const { ip, source } = await getIPFromAliCDN(); + const { ip, source } = await getIPFromUpai(); return { ip: ip, source: source