客户端显示IP信息
This commit is contained in:
@@ -44,8 +44,9 @@ async function getIpGeolocation(ip) {
|
||||
const data = await response.json();
|
||||
let location = "未知 未知";
|
||||
|
||||
if (data && data.country && data.city) {
|
||||
location = `${data.country} ${data.city}`;
|
||||
if (data && data.addr) {
|
||||
// 直接使用addr字段作为完整的地理位置信息
|
||||
location = data.addr;
|
||||
}
|
||||
|
||||
// 保存到缓存
|
||||
|
||||
Reference in New Issue
Block a user