mirror of
https://github.com/fastapiadmin/FastapiAdmin.git
synced 2026-09-20 20:39:55 +00:00
fix(ip): 修复登录时获取 IP 归属地的问题
- 在 LoginService 和 OperationLogRoute 中,将 request.client.host 转换为字符串后再传递给 IpLocalUtil.get_ip_location - 在 IpLocalUtil 类中添加日志记录 IP 归属地获取过程
This commit is contained in:
@@ -94,7 +94,7 @@ class LoginService:
|
||||
name=user.name,
|
||||
user_name=user.username,
|
||||
ipaddr=request.client.host,
|
||||
login_location=IpLocalUtil.get_ip_location(request.client.host),
|
||||
login_location=IpLocalUtil.get_ip_location(str(request.client.host)),
|
||||
os=user_agent.os.family,
|
||||
browser = user_agent.browser.family,
|
||||
login_time=user.last_login
|
||||
|
||||
Reference in New Issue
Block a user