fix(ip): 修复登录时获取 IP 归属地的问题

- 在 LoginService 和 OperationLogRoute 中,将 request.client.host 转换为字符串后再传递给 IpLocalUtil.get_ip_location
- 在 IpLocalUtil 类中添加日志记录 IP 归属地获取过程
This commit is contained in:
zhangtao
2025-05-18 19:22:30 +08:00
parent 93cbe5d987
commit cc2c1931da
4 changed files with 16 additions and 3 deletions
@@ -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