mirror of
https://gitee.com/js-yhsec/energy_storage.git
synced 2026-05-27 18:59:26 +08:00
实现QT6启动器,QT版本有qt5升级到qt6
This commit is contained in:
@@ -22,11 +22,11 @@ bool Config::init(std::string filename)
|
||||
if (jsonroot.contains("database"))
|
||||
{
|
||||
njson 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") : "";
|
||||
option.database.passwd = json.contains("passwd") ? json.at("passwd") : "";
|
||||
option.database.dbname = json.contains("dbname") ? json.at("dbname") : "";
|
||||
JSON::read(json, "host", option.database.host);
|
||||
JSON::read(json, "port", option.database.port);
|
||||
JSON::read(json, "user", option.database.user);
|
||||
JSON::read(json, "passwd", option.database.passwd);
|
||||
JSON::read(json, "dbname", option.database.dbname);
|
||||
|
||||
spdlog::info("[config] parse database success. host={}", option.database.host);
|
||||
}
|
||||
@@ -60,10 +60,8 @@ bool Config::init(std::string filename)
|
||||
spdlog::info("[config] parse mqtt failed: not found.");
|
||||
}
|
||||
|
||||
if (jsonroot.contains("weburl"))
|
||||
{
|
||||
JSON::read(jsonroot, "weburl", option.webSrvUrl);
|
||||
}
|
||||
JSON::read(jsonroot, "weburl", option.webSrvUrl);
|
||||
JSON::read(jsonroot, "launchdate", option.lunchDate);
|
||||
|
||||
return true;
|
||||
}
|
||||
Reference in New Issue
Block a user