Skip to content

Commit

Permalink
fix:修复定时任务包含登录接口也会记录日志的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
JIang Bing committed Apr 10, 2024
1 parent 58d0209 commit 2aa89ce
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions backend/backend/utils/request_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,13 @@ def save_login_log(request):
:return:
"""
ip = get_request_ip(request=request)

# 过滤掉平台自身的服务器 IP 地址
platform_ips = ["127.0.0.1", "47.119.28.171"]
# 如果请求来自平台自身的 IP,跳过记录日志
if ip in platform_ips:
return

analysis_data = get_ip_analysis(ip=ip)
analysis_data.update(
{
Expand Down

0 comments on commit 2aa89ce

Please sign in to comment.