客户端显示IP信息

This commit is contained in:
Alex Yang
2026-01-02 22:51:03 +08:00
parent dc2deb98b8
commit 1dd1f15788

View File

@@ -44,8 +44,9 @@ async function getIpGeolocation(ip) {
const data = await response.json(); const data = await response.json();
let location = "未知 未知"; let location = "未知 未知";
if (data && data.country && data.city) { if (data && data.addr) {
location = `${data.country} ${data.city}`; // 直接使用addr字段作为完整的地理位置信息
location = data.addr;
} }
// 保存到缓存 // 保存到缓存