mirror of
https://github.com/snowykami/neo-blog.git
synced 2025-09-26 11:06:23 +00:00
fix: 修正创建评论时获取远程地址的方式,使用客户端IP替代原有方法
This commit is contained in:
@ -31,7 +31,7 @@ func (cc *CommentController) CreateComment(ctx context.Context, c *app.RequestCo
|
||||
resps.BadRequest(c, err.Error())
|
||||
return
|
||||
}
|
||||
req.RemoteAddr = c.RemoteAddr().String()
|
||||
req.RemoteAddr = c.ClientIP()
|
||||
req.UserAgent = string(c.UserAgent())
|
||||
commentID, err := cc.service.CreateComment(ctx, &req)
|
||||
if err != nil {
|
||||
|
Reference in New Issue
Block a user