mirror of
https://github.com/fastapiadmin/FastapiAdmin.git
synced 2026-09-20 20:39:55 +00:00
refactor: 移除IP地址转换字符串的冗余操作
在多个文件中,`request.client.host` 已经是字符串类型,无需再使用 `str()` 进行转换。此次修改简化了代码,避免了不必要的类型转换操作。
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(str(request.client.host)),
|
||||
login_location=IpLocalUtil.get_ip_location(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