mirror of
https://gitee.com/js-yhsec/energy_storage.git
synced 2026-05-27 18:59:26 +08:00
实现削峰套利策略的编辑页面
This commit is contained in:
@@ -9,8 +9,8 @@ AppOption Config::option;
|
||||
|
||||
bool Config::init(std::string filename)
|
||||
{
|
||||
NJson jsonroot;
|
||||
bool ret = NJsonLoad(filename, jsonroot);
|
||||
NJsonNode jsonroot;
|
||||
bool ret = NJson::load(filename, jsonroot);
|
||||
if (!ret)
|
||||
{
|
||||
XLOGE() << "[APP] load config failed, filename=" << filename;
|
||||
@@ -20,7 +20,7 @@ bool Config::init(std::string filename)
|
||||
|
||||
if (jsonroot.contains("database"))
|
||||
{
|
||||
NJson json = jsonroot.at("database");
|
||||
NJsonNode json = jsonroot.at("database");
|
||||
option.database.host = json.contains("host") ? json.at("host") : "";
|
||||
option.database.port = json.contains("port") ? json.at("port") : 0;
|
||||
option.database.user = json.contains("user") ? json.at("user") : "";
|
||||
|
||||
Reference in New Issue
Block a user