修复编辑更新文档时候初始化分类一直为默认分类
parent
aaa53075f3
commit
8307df0d08
|
@ -82,6 +82,7 @@ func Init(path string) error {
|
||||||
log.Println(e.Error())
|
log.Println(e.Error())
|
||||||
}
|
}
|
||||||
gConf.init = true
|
gConf.init = true
|
||||||
|
log.Print(gConf)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -22,10 +22,14 @@ func Init() {
|
||||||
mysqlconf := config.GetMysqlConfig()
|
mysqlconf := config.GetMysqlConfig()
|
||||||
blogConf := config.GetMysqlBlogConfig()
|
blogConf := config.GetMysqlBlogConfig()
|
||||||
//InitMongoDb()
|
//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"{
|
if config.ApiConfig().RunMode == "debug"{
|
||||||
gDb = Database{Type: string(""), DB: initMysql(mysqlconf)}
|
gDb = Database{Type: string(""), DB: initMysql(mysqlconf)}
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
gDb = Database{Type: string(""), DB: initMysqlTLS(mysqlconf)}
|
gDb = Database{Type: string(""), DB: initMysqlTLS(mysqlconf)}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue