mirror of https://github.com/jumpserver/jumpserver
[Bugfix] 修改获取城市
parent
2e8f5919a8
commit
e1cab35db0
|
@ -200,7 +200,7 @@ def get_ip_city(ip, timeout=10):
|
||||||
url = 'http://int.dpool.sina.com.cn/iplookup/iplookup.php?ip=%s&format=json' % ip
|
url = 'http://int.dpool.sina.com.cn/iplookup/iplookup.php?ip=%s&format=json' % ip
|
||||||
try:
|
try:
|
||||||
r = requests.get(url, timeout=timeout)
|
r = requests.get(url, timeout=timeout)
|
||||||
except requests.Timeout:
|
except:
|
||||||
r = None
|
r = None
|
||||||
city = 'Unknown'
|
city = 'Unknown'
|
||||||
if r and r.status_code == 200:
|
if r and r.status_code == 200:
|
||||||
|
|
Loading…
Reference in New Issue