feat:更新博客访客记录
This commit is contained in:
@@ -9,8 +9,9 @@ from middleware.exceptions import AppException
|
||||
|
||||
|
||||
async def blog_visit_middleware(request: Request, call_next):
|
||||
# 检查路径是否匹配 /blog/content/{blog_id}
|
||||
if match := re.match(r"^/blog/content/(\d+)$", request.url.path):
|
||||
# 检查路径是否匹配
|
||||
if match := re.match(r"^/blog/(\d+)/content$", request.url.path):
|
||||
|
||||
# 获取客户端信息
|
||||
ip = get_client_ip(request)
|
||||
user_agent = request.headers.get("User-Agent", "")
|
||||
|
||||
Reference in New Issue
Block a user