mirror of https://github.com/jumpserver/jumpserver
fix: 请求 token 接口,登录类型没内容
parent
73b67da4c0
commit
7da14571ac
|
@ -0,0 +1,18 @@
|
|||
# Generated by Django 3.1 on 2021-04-14 06:43
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('audits', '0011_userloginlog_backend'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='userloginlog',
|
||||
name='type',
|
||||
field=models.CharField(choices=[('W', 'Web'), ('T', 'Terminal'), ('U', 'Unknown')], max_length=2, verbose_name='Login type'),
|
||||
),
|
||||
]
|
|
@ -79,6 +79,7 @@ class UserLoginLog(models.Model):
|
|||
LOGIN_TYPE_CHOICE = (
|
||||
('W', 'Web'),
|
||||
('T', 'Terminal'),
|
||||
('U', 'Unknown'),
|
||||
)
|
||||
|
||||
MFA_DISABLED = 0
|
||||
|
|
|
@ -146,7 +146,7 @@ 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_type = request.META.get('HTTP_X_JMS_LOGIN_TYPE', '')
|
||||
login_type = request.META.get('HTTP_X_JMS_LOGIN_TYPE', 'U')
|
||||
else:
|
||||
login_type = 'W'
|
||||
|
||||
|
|
Loading…
Reference in New Issue