修复编辑更新文档时候初始化分类一直为默认分类

master
a7458969 2020-02-26 23:10:29 +08:00
parent aaa53075f3
commit 8307df0d08
2 changed files with 7 additions and 2 deletions

View File

@ -82,6 +82,7 @@ func Init(path string) error {
log.Println(e.Error())
}
gConf.init = true
log.Print(gConf)
return nil
}

View File

@ -22,10 +22,14 @@ func Init() {
mysqlconf := config.GetMysqlConfig()
blogConf := config.GetMysqlBlogConfig()
//InitMongoDb()
blogDb = Database{Type: string(""), DB: initMysql(blogConf)}
fmt.Print("api runmode is " + config.ApiConfig().RunMode)
if config.ApiConfig().RunMode == "debug"{
blogDb = Database{Type: string(""), DB: initMysql(blogConf)}
}else{
blogDb = Database{Type: string(""), DB: initMysqlTLS(blogConf)}
}
if config.ApiConfig().RunMode == "debug"{
gDb = Database{Type: string(""), DB: initMysql(mysqlconf)}
}else{
gDb = Database{Type: string(""), DB: initMysqlTLS(mysqlconf)}
}