提交 7f9644db 编写于 作者: B Bai

[Update] 修改获取用户登录的ip和type

上级 23b896b3
......@@ -111,12 +111,10 @@ def on_audits_log_create(sender, instance=None, **kwargs):
def generate_data(username, request):
user_agent = request.META.get('HTTP_USER_AGENT', '')
login_ip = get_request_ip(request) or '0.0.0.0'
if isinstance(request, Request):
login_ip = request.data.get('remote_addr', '0.0.0.0')
login_type = request.data.get('login_type', '')
login_type = request.META.get('HTTP_X_JMS_LOGIN_TYPE', '')
else:
login_ip = get_request_ip(request) or '0.0.0.0'
login_type = 'W'
data = {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册