This commit is contained in:
abearxiong committed 2025-11-16 13:32:35 +08:00
1 parent e35712820f
commit 2c800d336c
11 files changed
+414 -18

No files matched your search

+8
View File
@@ -0,0 +1,8 @@
const baseURLv4 = 'https://4.ipw.cn/';
const baseURLv6 = 'https://6.ipw.cn/';
export const getPublicIp = async (type: 'v4' | 'v6'): Promise<string> => {
const url = type === 'v4' ? baseURLv4 : baseURLv6;
const response = await fetch(url);
const ip = (await response.text()).trim();
return ip;
}