mirror of https://github.com/jumpserver/jumpserver
commit
13a042bc0f
|
@ -111,12 +111,10 @@ def on_audits_log_create(sender, instance=None, **kwargs):
|
||||||
|
|
||||||
def generate_data(username, request):
|
def generate_data(username, request):
|
||||||
user_agent = request.META.get('HTTP_USER_AGENT', '')
|
user_agent = request.META.get('HTTP_USER_AGENT', '')
|
||||||
|
|
||||||
if isinstance(request, Request):
|
|
||||||
login_ip = request.data.get('remote_addr', '0.0.0.0')
|
|
||||||
login_type = request.data.get('login_type', '')
|
|
||||||
else:
|
|
||||||
login_ip = get_request_ip(request) or '0.0.0.0'
|
login_ip = get_request_ip(request) or '0.0.0.0'
|
||||||
|
if isinstance(request, Request):
|
||||||
|
login_type = request.META.get('HTTP_X_JMS_LOGIN_TYPE', '')
|
||||||
|
else:
|
||||||
login_type = 'W'
|
login_type = 'W'
|
||||||
|
|
||||||
data = {
|
data = {
|
||||||
|
|
Loading…
Reference in New Issue