客户端显示IP信息
This commit is contained in:
@@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 保存到缓存
|
// 保存到缓存
|
||||||
|
|||||||
Reference in New Issue
Block a user