|
@@ -492,11 +492,13 @@ define(
|
|
|
if (data.lastLoginIp == null || data.lastLoginIp == "" || data.lastLoginIp == undefined) {
|
|
if (data.lastLoginIp == null || data.lastLoginIp == "" || data.lastLoginIp == undefined) {
|
|
|
data.lastLoginIp = firstMsg
|
|
data.lastLoginIp = firstMsg
|
|
|
}
|
|
}
|
|
|
|
|
+ data.lastLoginIp = data.lastLoginIp ? data.lastLoginIp.split(",")[0] : ""
|
|
|
|
|
+ data.currLoginIp = data.currLoginIp ? data.currLoginIp.split(",")[0] : ""
|
|
|
$(".main").html(template.compile(a)({ G: G, LNG: LNG, data: data }))
|
|
$(".main").html(template.compile(a)({ G: G, LNG: LNG, data: data }))
|
|
|
- $.getScript("http://int.dpool.sina.com.cn/iplookup/iplookup.php?format=js&ip=" + data.currLoginIp, function (r, s) {
|
|
|
|
|
|
|
+ $.get("/queryIp?type=1&ip=" + data.currLoginIp, function (s) {
|
|
|
var msg = "载入中..."
|
|
var msg = "载入中..."
|
|
|
- if (s == "success") {
|
|
|
|
|
- msg = remote_ip_info.province + " " + remote_ip_info.city
|
|
|
|
|
|
|
+ if (s.code == 0) {
|
|
|
|
|
+ msg = s.address
|
|
|
} else {
|
|
} else {
|
|
|
msg = "获取失败"
|
|
msg = "获取失败"
|
|
|
}
|
|
}
|
|
@@ -505,10 +507,11 @@ define(
|
|
|
if (firstMsg == data.lastLoginIp) {
|
|
if (firstMsg == data.lastLoginIp) {
|
|
|
$("#lastLoginAddr").text(firstMsg)
|
|
$("#lastLoginAddr").text(firstMsg)
|
|
|
} else {
|
|
} else {
|
|
|
- $.getScript("http://int.dpool.sina.com.cn/iplookup/iplookup.php?format=js&ip=" + data.lastLoginIp, function (r, s) {
|
|
|
|
|
|
|
+ //https://www.ip.cn/api/index?type=1&ip= Nignx代理到此地址,否则会出现跨域错误
|
|
|
|
|
+ $.get("/queryIp?type=1&ip=" + data.lastLoginIp, function (s) {
|
|
|
var msg = "载入中..."
|
|
var msg = "载入中..."
|
|
|
- if (s == "success") {
|
|
|
|
|
- msg = remote_ip_info.province + " " + remote_ip_info.city
|
|
|
|
|
|
|
+ if (s && s.code == 0) {
|
|
|
|
|
+ msg = s.address
|
|
|
} else {
|
|
} else {
|
|
|
msg = "获取失败"
|
|
msg = "获取失败"
|
|
|
}
|
|
}
|