Skip to content

Commit 2aa89ce

Browse files
author
JIang Bing
committed
fix:修复定时任务包含登录接口也会记录日志的问题
1 parent 58d0209 commit 2aa89ce

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

backend/backend/utils/request_util.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,13 @@ def save_login_log(request):
101101
:return:
102102
"""
103103
ip = get_request_ip(request=request)
104+
105+
# 过滤掉平台自身的服务器 IP 地址
106+
platform_ips = ["127.0.0.1", "47.119.28.171"]
107+
# 如果请求来自平台自身的 IP,跳过记录日志
108+
if ip in platform_ips:
109+
return
110+
104111
analysis_data = get_ip_analysis(ip=ip)
105112
analysis_data.update(
106113
{

0 commit comments

Comments
 (0)