From 5e72ef4cd454af06889342306e91cab3f1233e24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=85=89=E6=98=A5?= Date: Thu, 22 Sep 2022 15:46:02 +0800 Subject: [PATCH] - update --- api.go | 1 - const.go | 2 +- gin.go | 8 ++++++++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/api.go b/api.go index 38cc666..abd4d68 100644 --- a/api.go +++ b/api.go @@ -61,7 +61,6 @@ func NewApiClient(config *ApiClientConfig) (*ApiClient, error) { if config.CurrentIp != "" && config.CurrentIp != "0.0.0.0" { c.config.systemOutsideIp = config.CurrentIp } - if c.config.systemOutsideIp == "" { return nil, currentIpNoConfig } diff --git a/const.go b/const.go index 8aa50ed..4d05ac2 100644 --- a/const.go +++ b/const.go @@ -1,5 +1,5 @@ package golog const ( - Version = "1.0.96" + Version = "1.0.97" ) diff --git a/gin.go b/gin.go index 845713d..72f389a 100644 --- a/gin.go +++ b/gin.go @@ -55,6 +55,7 @@ type GinClientConfig struct { GormClientFun dorm.GormClientTableFun // 日志配置 MongoClientFun dorm.MongoClientCollectionFun // 日志配置 ZapLog *ZapLog // 日志服务 + CurrentIp string // 当前ip } // NewGinClient 创建框架实例化 @@ -66,6 +67,13 @@ func NewGinClient(config *GinClientConfig) (*GinClient, error) { c.zapLog = config.ZapLog + if config.CurrentIp != "" && config.CurrentIp != "0.0.0.0" { + c.config.systemOutsideIp = config.CurrentIp + } + if c.config.systemOutsideIp == "" { + return nil, currentIpNoConfig + } + c.ipService = config.IpService // 配置信息