docs📝: 修改接口文档

This commit is contained in:
zhangwenjian committed 2021-06-29 16:30:47 +08:00
1 parent 0607d462d0
commit 3fd34db3c1
16 files changed
+541 -289

No files matched your search

+3 -4
View File
@@ -1,16 +1,15 @@
package common
import (
"fmt"
"github.com/gin-gonic/gin"
"strings"
)
func GetClientIP(c *gin.Context) string {
ClientIP := c.ClientIP()
fmt.Println("ClientIP:", ClientIP)
//fmt.Println("ClientIP:", ClientIP)
RemoteIP, _ := c.RemoteIP()
fmt.Println("RemoteIP:", RemoteIP)
//fmt.Println("RemoteIP:", RemoteIP)
ip := c.Request.Header.Get("X-Forwarded-For")
if strings.Contains(ip, "127.0.0.1") || ip == "" {
ip = c.Request.Header.Get("X-real-ip")
@@ -24,6 +23,6 @@ func GetClientIP(c *gin.Context) string {
if ClientIP != "127.0.0.1" {
ip = ClientIP
}
fmt.Println("ip:", ip)
//fmt.Println("ip:", ip)
return ip
}