From 9070bd2fe70865e7c8267d34d75e25693f53ed1b Mon Sep 17 00:00:00 2001 From: hoteas <925970985@qq.com> Date: Sun, 10 Nov 2019 18:10:26 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=B5=81=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .idea/workspace.xml | 21 ++++++++++++--------- application.go | 5 +++-- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 6e9c776..eedd6eb 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -1,12 +1,7 @@ - - - - - - + @@ -132,6 +134,7 @@ - \ No newline at end of file diff --git a/application.go b/application.go index c0d0480..604cfe6 100644 --- a/application.go +++ b/application.go @@ -163,8 +163,9 @@ func (this *Application) SetSession(short CacheIns, Long CacheIns) { //默认配置缓存和session实现 func (this *Application) SetDefault(connect func(err ...*Error) *sql.DB) { this.SetConfig() - this.connectDbFunc = connect - if this.connectDbFunc != nil { + + if connect != nil { + this.connectDbFunc = connect this.Db.SetConnect(this.connectDbFunc) }