修复CDN环境下获取真实客户端IP的问题

This commit is contained in:
2026-06-24 11:18:56 +08:00
parent fe69a2e38b
commit 1fc933e014
3 changed files with 19 additions and 2 deletions
+1 -1
View File
@@ -306,7 +306,7 @@ func recordArticleView(db *gorm.DB, articleID uint, c *gin.Context) {
}
// Get client IP and User-Agent
ip := c.ClientIP()
ip := GetClientIP(c)
userAgent := c.Request.UserAgent()
isBot := models.IsBot(userAgent)