功能变化: 通过调用api获取ip详细地址改为get请求方式

pull/54/head^2
李强 2022-04-26 21:40:41 +08:00
parent 8509a18816
commit f8561b4ea1
2 changed files with 2 additions and 4 deletions

View File

@ -27,9 +27,7 @@ APP_PREFIX = "app_"
# ****************** 功能 启停 ******************* #
# ================================================= #
DEBUG = False
# 是否启用插件不需要可以设置为False
ENABLE_PLUGINS = False
# 启动登录详细概略获取(通过调用api获取ip详细地址)
# 启动登录详细概略获取(通过调用api获取ip详细地址。如果是内网关闭即可)
ENABLE_LOGIN_ANALYSIS_LOG = True
# 是否启用登录验证码不需要可以设置为False
CAPTCHA_STATE = False

View File

@ -190,7 +190,7 @@ def get_ip_analysis(ip):
}
if ip != 'unknown' and ip:
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:
res_data = res.json()
if res_data.get('code') == 0: