Merge branch 'v2.x' of gitee.com:liqianglog/django-vue-admin into to_merge
commit
c0b83994ad
|
@ -35,7 +35,7 @@ TABLE_PREFIX = "sys_"
|
||||||
# ****************** 功能 启停 ******************* #
|
# ****************** 功能 启停 ******************* #
|
||||||
# ================================================= #
|
# ================================================= #
|
||||||
DEBUG = False
|
DEBUG = False
|
||||||
# 启动登录详细概略获取(通过调用api获取ip详细地址)
|
# 启动登录详细概略获取(通过调用api获取ip详细地址。如果是内网,关闭即可)
|
||||||
ENABLE_LOGIN_ANALYSIS_LOG = True
|
ENABLE_LOGIN_ANALYSIS_LOG = True
|
||||||
# 是否启用登录验证码,不需要可以设置为False
|
# 是否启用登录验证码,不需要可以设置为False
|
||||||
CAPTCHA_STATE = False
|
CAPTCHA_STATE = False
|
||||||
|
|
|
@ -190,7 +190,7 @@ def get_ip_analysis(ip):
|
||||||
}
|
}
|
||||||
if ip != 'unknown' and ip:
|
if ip != 'unknown' and ip:
|
||||||
if getattr(settings, 'ENABLE_LOGIN_ANALYSIS_LOG', True):
|
if getattr(settings, 'ENABLE_LOGIN_ANALYSIS_LOG', True):
|
||||||
res = requests.post(url='https://ip.django-vue-admin.com/ip/analysis', data=json.dumps({"ip": ip}))
|
res = requests.get(url='https://ip.django-vue-admin.com/ip/analysis', params={"ip": ip})
|
||||||
if res.status_code == 200:
|
if res.status_code == 200:
|
||||||
res_data = res.json()
|
res_data = res.json()
|
||||||
if res_data.get('code') == 0:
|
if res_data.get('code') == 0:
|
||||||
|
|
Loading…
Reference in New Issue