From fa641b9dcd68373af10e36221dcc68beaedc7276 Mon Sep 17 00:00:00 2001 From: hoteas <925970985@qq.com> Date: Sun, 10 Nov 2019 16:49:05 +0800 Subject: [PATCH] =?UTF-8?q?=E8=87=AA=E5=8A=A8=E8=AE=BE=E7=BD=AE=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .idea/workspace.xml | 23 ++++++++++++----------- dri/db/auto.go | 2 +- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 6b759f4..e761496 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -1,14 +1,7 @@ - - - - - - - - + @@ -111,6 +111,7 @@ - \ No newline at end of file diff --git a/dri/db/auto.go b/dri/db/auto.go index 4137107..65cd02c 100644 --- a/dri/db/auto.go +++ b/dri/db/auto.go @@ -8,7 +8,7 @@ import ( ) func SetDB(appIns *hotime.Application) { - if appIns.Config.GetString("dbType") == "sqlite" || strings.Contains(appIns.Config.GetString("dbName"), ".db") { + if appIns.Config.GetString("dbType") == "sqlite" || strings.Index(appIns.Config.GetString("dbName"), ".db") == len(appIns.Config.GetString("dbName"))-3 { sqlite.SetDB(appIns) } else { mysql.SetDB(appIns)