Skip to content

Commit

Permalink
Improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
jason5ng32 committed Sep 12, 2024
1 parent 2ffbba3 commit 2d4f063
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
1 change: 1 addition & 0 deletions frontend/utils/getips/cloudflare-v6.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ const getIPFromCloudflare_V6 = async () => {
};
}
} catch (error) {
console.error("Error fetching IP from Cloudflare:", error);
return {
ip: null,
source: "Cloudflare IPv6"
Expand Down
5 changes: 1 addition & 4 deletions frontend/utils/getips/index.js
Original file line number Diff line number Diff line change
@@ -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};
export { getIPFromIPIP, getIPFromCloudflare_V4, getIPFromCloudflare_V6, getIPFromIPChecking64, getIPFromIPChecking4, getIPFromIPChecking6};
5 changes: 2 additions & 3 deletions frontend/utils/getips/ipipnet.js
Original file line number Diff line number Diff line change
@@ -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 地址
Expand All @@ -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
Expand Down

0 comments on commit 2d4f063

Please sign in to comment.