fix: DB空数据源时选择默认

This commit is contained in:
TsMask committed 2024-11-12 10:15:30 +08:00
1 parent 38dec905d5
commit 1a9e5735a4
1 file changed
+3
+3
View File
@@ -117,6 +117,9 @@ func DefaultDB() *gorm.DB {
// 获取数据源
func DB(source string) *gorm.DB {
if source == "" {
source = config.Get("gorm.defaultDataSourceName").(string)
}
return dbMap[source]
}