mirror of
https://github.com/fastapiadmin/FastapiAdmin.git
synced 2026-09-21 12:52:26 +00:00
feat(dependencies): update asyncmy and pandas versions for improved performance and compatibility
- Upgraded asyncmy from version 0.2.9 to 0.2.11 to leverage enhancements and bug fixes. - Updated pandas from version 2.2.2 to 2.2.3 for better data processing capabilities. - Added a new configuration option LOGIN_RESOLVE_IP_LOCATION to control IP location resolution during login. - Enhanced login service to handle IP location resolution based on the new configuration. - Improved validation logic in menu request handling to ensure proper redirection address for specific menu types. - Adjusted CRUD template generation to dynamically use primary key column names for better flexibility. - Updated Vue components to ensure proper handling of dynamic primary key references in menu items and forms.
This commit is contained in:
@@ -145,7 +145,14 @@ class LoginService:
|
||||
# 若没有 X-Forwarded-For 头,则使用 request.client.host
|
||||
request_ip = request.client.host if request.client else "127.0.0.1"
|
||||
|
||||
login_location = await IpLocalUtil.get_ip_location(request_ip)
|
||||
if settings.LOGIN_RESOLVE_IP_LOCATION:
|
||||
login_location = await IpLocalUtil.get_ip_location(request_ip)
|
||||
else:
|
||||
login_location = (
|
||||
"内网IP"
|
||||
if IpLocalUtil.is_private_ip(request_ip)
|
||||
else "未解析(已关闭归属地查询)"
|
||||
)
|
||||
request.scope["login_location"] = login_location
|
||||
|
||||
# 确保在请求上下文中设置用户名和会话ID
|
||||
|
||||
Reference in New Issue
Block a user