修复编辑更新文档时候初始化分类一直为默认分类
parent
aaa53075f3
commit
8307df0d08
|
@ -82,6 +82,7 @@ func Init(path string) error {
|
|||
log.Println(e.Error())
|
||||
}
|
||||
gConf.init = true
|
||||
log.Print(gConf)
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
|
@ -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)}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue