config🔧: Modify the client IP acquisition method

This commit is contained in:
zhangwenjian committed 2022-08-08 09:26:14 +08:00
1 parent 087ba38c24
commit 50a3b39666
1 file changed
+1 -2
+1 -2
View File
@@ -2,7 +2,6 @@ package middleware
import ( import (
"fmt" "fmt"
"go-admin/common"
"net/http" "net/http"
"strconv" "strconv"
"strings" "strings"
@@ -34,7 +33,7 @@ func CustomError(c *gin.Context) {
c.Request.URL, c.Request.URL,
statusCode, statusCode,
c.Request.RequestURI, c.Request.RequestURI,
common.GetClientIP(c), c.ClientIP(),
p[2], p[2],
) )
c.JSON(http.StatusOK, gin.H{ c.JSON(http.StatusOK, gin.H{